diff --git a/meshmode/mesh/refinement/__init__.py b/meshmode/mesh/refinement/__init__.py index 0d7b29b31d57387063a907e14f8f961a02e05d7a..3aeda0e8faca13ca78fc44f4e144cb9b5439a0b9 100644 --- a/meshmode/mesh/refinement/__init__.py +++ b/meshmode/mesh/refinement/__init__.py @@ -934,14 +934,16 @@ class Refiner(object): # }}} -def refine_uniformly(mesh, iterations): +def refine_uniformly(mesh, iterations, with_adjacency=True): + if with_adjacency: refiner = Refiner(mesh) - for i in range(iterations): - flags = np.ones(mesh.nelements, dtype=bool) - refiner.refine(flags) - mesh = refiner.get_current_mesh() + else: + refiner = RefinerWithoutAdjacency(mesh) - return mesh + for _ in range(iterations): + refiner.refine_uniformly() + + return refiner.get_current_mesh() # vim: foldmethod=marker