Skip to content

Commit

Permalink
Fix mesh constructor again
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed Sep 24, 2024
1 parent 4ae2d4b commit 6939f19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/dolfinx/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,9 @@ def refine(
mesh1, parent_cell, parent_facet = _cpp.refinement.refine(
mesh._cpp_object, edges, redistribute, ghost_mode, option
)
return Mesh(mesh1, mesh._ufl_domain), parent_cell, parent_facet
# Create new ufl domain as it will carry a reference to the C++ mesh in the ufl_cargo
ufl_domain = ufl.Mesh(mesh._ufl_domain.ufl_coordinate_element()) # type: ignore
return Mesh(mesh1, ufl_domain), parent_cell, parent_facet


def create_mesh(
Expand Down

0 comments on commit 6939f19

Please sign in to comment.