Skip to content

Commit dc8a2e6

Browse files
committed
Fix remaining entity maps
1 parent f59faf6 commit dc8a2e6

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

src/festim/hydrogen_transport_problem.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,28 +1652,40 @@ def post_processing(self):
16521652
submesh_function = (
16531653
export.field.subdomain_to_post_processing_solution[export_vol]
16541654
)
1655-
export.compute(
1656-
u=submesh_function,
1657-
ds=self.ds,
1658-
entity_maps={
1655+
try:
1656+
from dolfinx.mesh import EntityMap # noqa: F401
1657+
1658+
entity_maps = [sd.cell_map for sd in self.volume_subdomains]
1659+
except ImportError:
1660+
entity_maps = {
16591661
sd.submesh: sd.parent_to_submesh
16601662
for sd in self.volume_subdomains
1661-
},
1663+
}
1664+
1665+
export.compute(
1666+
u=submesh_function, ds=self.ds, entity_maps=entity_maps
16621667
)
16631668
else:
16641669
export.compute()
16651670

16661671
elif isinstance(export, exports.VolumeQuantity):
16671672
if isinstance(export, exports.TotalVolume | exports.AverageVolume):
1673+
try:
1674+
from dolfinx.mesh import EntityMap # noqa: F401
1675+
1676+
entity_maps = [sd.cell_map for sd in self.volume_subdomains]
1677+
except ImportError:
1678+
entity_maps = {
1679+
sd.submesh: sd.parent_to_submesh
1680+
for sd in self.volume_subdomains
1681+
}
1682+
16681683
export.compute(
16691684
u=export.field.subdomain_to_post_processing_solution[
16701685
export_vol
16711686
],
16721687
dx=self.dx,
1673-
entity_maps={
1674-
sd.submesh: sd.parent_to_submesh
1675-
for sd in self.volume_subdomains
1676-
},
1688+
entity_maps=entity_maps,
16771689
)
16781690
else:
16791691
export.compute()

0 commit comments

Comments
 (0)