Skip to content

Commit 70535f7

Browse files
don't make new D object for exports in disconinuous case
1 parent 32d138d commit 70535f7

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

src/festim/hydrogen_transport_problem.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,25 +1692,17 @@ def initialise_exports(self):
16921692
)
16931693

16941694
# compute diffusivity function for surface fluxes
1695-
1696-
spe_to_D_global = {} # links species to global D function
1697-
spe_to_D_global_expr = {} # links species to D expression
1698-
1695+
# for the discontinuous case, we don't use D_global as in
1696+
# HydrogenTransportProblem
16991697
for export in self.exports:
17001698
if isinstance(export, exports.SurfaceQuantity):
1701-
if export.field in spe_to_D_global:
1702-
# if already computed then use the same D
1703-
D = spe_to_D_global[export.field]
1704-
D_expr = spe_to_D_global_expr[export.field]
1705-
else:
1706-
# compute D and add it to the dict
1707-
D, D_expr = self.define_D_global(export.field)
1708-
spe_to_D_global[export.field] = D
1709-
spe_to_D_global_expr[export.field] = D_expr
1699+
volume = self.surface_to_volume[export.surface]
1700+
D = volume.material.get_diffusion_coefficient(
1701+
self.mesh.mesh, self.temperature_fenics, export.field
1702+
)
1703+
# NOTE: maybe we need to make sure there are no functionspace clashes?
17101704

1711-
# add the global D to the export
17121705
export.D = D
1713-
export.D_expr = D_expr
17141706

17151707
# reset the data and time for SurfaceQuantity and VolumeQuantity
17161708
if isinstance(export, exports.SurfaceQuantity | exports.VolumeQuantity):

0 commit comments

Comments
 (0)