Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve default mesh name after Netgen mesh creation #3951

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions firedrake/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -3064,6 +3064,7 @@ def Mesh(meshfile, **kwargs):
netgen_flags = kwargs.get("netgen_flags", {"quad": False, "transform": None, "purify_to_tets": False})
netgen_firedrake_mesh = FiredrakeMesh(meshfile, netgen_flags, user_comm)
plex = netgen_firedrake_mesh.meshMap.petscPlex
plex.setName(_generate_default_mesh_topology_name(name))
else:
basename, ext = os.path.splitext(meshfile)
if ext.lower() in ['.e', '.exo']:
Expand All @@ -3090,10 +3091,11 @@ def Mesh(meshfile, **kwargs):
distribution_name=kwargs.get("distribution_name"),
permutation_name=kwargs.get("permutation_name"),
comm=user_comm)
mesh = make_mesh_from_mesh_topology(topology, name)
if netgen and isinstance(meshfile, netgen.libngpy._meshing.Mesh):
netgen_firedrake_mesh.createFromTopology(topology, name=plex.getName(), comm=user_comm)
netgen_firedrake_mesh.createFromTopology(topology, name=name, comm=user_comm)
mesh = netgen_firedrake_mesh.firedrakeMesh
else:
mesh = make_mesh_from_mesh_topology(topology, name)
mesh._tolerance = tolerance
return mesh

Expand Down
Loading