Skip to content

Commit 099ea9d

Browse files
authored
Fix Submesh.submesh_parent (#4207)
* Fix Submesh.parent
1 parent a9f2c62 commit 099ea9d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

firedrake/mesh.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4676,6 +4676,6 @@ def Submesh(mesh, subdim, subdomain_id, label_name=None, name=None):
46764676
submesh = Mesh(subplex, name=name, distribution_parameters={"partition": False,
46774677
"overlap_type": (DistributedMeshOverlapType.NONE, 0)})
46784678
submesh.topology.submesh_parent = mesh.topology
4679-
submesh.submesh_parent = mesh
46804679
submesh.init()
4680+
submesh.submesh_parent = mesh
46814681
return submesh
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from firedrake import *
2+
3+
4+
def test_submesh_parent():
5+
mesh = UnitIntervalMesh(2)
6+
7+
M = FunctionSpace(mesh, "DG", 0)
8+
m = Function(M)
9+
m.dat.data[0] = 1
10+
11+
cell_marker = 100
12+
parent = RelabeledMesh(mesh, [m], [cell_marker])
13+
14+
submesh = Submesh(parent, parent.topological_dimension(), cell_marker)
15+
assert submesh.topology.submesh_parent is parent.topology
16+
assert submesh.submesh_parent is parent

0 commit comments

Comments
 (0)