mesh-adaptation / goalie

Goal-oriented error estimation and mesh adaptation for finite element problems solved using Firedrake
Other
2 stars 0 forks source link

Error with h-enrichment in parallel #144

Open ddundo opened 8 months ago

ddundo commented 8 months ago

Running burgers_ee.py (error estimation with h-enrichment) in parallel raises an error:

Traceback (most recent call last):
  File "/home/firedrake/firedrake/src/goalie/demos/burgers_ee.py", line 144, in <module>
    solutions, indicators = mesh_seq.indicate_errors(
  File "/home/firedrake/firedrake/src/goalie/goalie/go_mesh_seq.py", line 150, in indicate_errors
    enriched_mesh_seq = self.get_enriched_mesh_seq(**enrichment_kwargs)
  File "petsc4py/PETSc/Log.pyx", line 188, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
  File "petsc4py/PETSc/Log.pyx", line 189, in petsc4py.PETSc.Log.EventDecorator.decorator.wrapped_func
  File "/home/firedrake/firedrake/src/goalie/goalie/go_mesh_seq.py", line 57, in get_enriched_mesh_seq
  File "/home/firedrake/firedrake/src/firedrake/firedrake/mg/mesh.py", line 138, in MeshHierarchy
    meshes = [MeshHierarchy(mesh, num_enrichments)[-1] for mesh in self.meshes]
RuntimeError: Cannot refine parallel overlapped meshes (make sure the MeshHierarchy is built immediately after the Mesh)
    raise RuntimeError("Cannot refine parallel overlapped meshes "
application called MPI_Abort(PYOP2_COMM_WORLD, 1) - process 0

So I guess we'd have to create the MeshHierarchy at the very start, before any connectivities are created (i.e. before set_meshes in MeshSeq which calls _reset_count). Maybe it's best to create new mesh objects from the ones that are passed to MeshSeq since users might also do something before initialising MeshSeq.

jwallwork23 commented 8 months ago

Relevant when addressing #122.