Skip to content

Commit 790cbb1

Browse files
committed
Merge branch 'main' into pep639
2 parents aca9e9f + 8b6fe03 commit 790cbb1

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

.cspell_dict.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ finsberg
4242
Francesco
4343
functionspace
4444
geodir
45+
gmsh
4546
gradu
4647
Grice
4748
Guccione

demo/time_dependent_land_circ_biv.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@
8585
robin_base = pulse.RobinBC(value=alpha_base, marker=geometry.markers["BASE"][0])
8686

8787

88-
lvv_initial = geometry.volume("ENDO_LV")
88+
lvv_initial = geo.mesh.comm.allreduce(geometry.volume("ENDO_LV"), op=MPI.SUM)
8989
lv_volume = dolfinx.fem.Constant(geometry.mesh, dolfinx.default_scalar_type(lvv_initial))
9090
lv_cavity = pulse.problem.Cavity(marker="ENDO_LV", volume=lv_volume)
9191

92-
rvv_initial = geometry.volume("ENDO_RV")
92+
rvv_initial = geo.mesh.comm.allreduce(geometry.volume("ENDO_RV"), op=MPI.SUM)
9393
rv_volume = dolfinx.fem.Constant(geometry.mesh, dolfinx.default_scalar_type(rvv_initial))
9494
rv_cavity = pulse.problem.Cavity(marker="ENDO_RV", volume=rv_volume)
9595

@@ -179,7 +179,8 @@ def solve_beat(times, states, dt, p, V_index, Ca_index, Vs, Cais, Tas):
179179
ax[2, 1].set_xlabel("Time [ms]")
180180

181181
fig.savefig(outdir / "Ta_ORdLand.png")
182-
np.save(state_file, y)
182+
if comm.rank == 0:
183+
np.save(state_file, y)
183184

184185
y = np.load(state_file)
185186

@@ -287,9 +288,7 @@ def p_BiV_func(V_LV, V_RV, t):
287288

288289
mL = circulation.units.ureg("mL")
289290
add_units = False
290-
surface_area_lv = geometry.surface_area("ENDO_LV")
291291
lvv_init = geo.mesh.comm.allreduce(geometry.volume("ENDO_LV", u=problem.u), op=MPI.SUM) * 1e6 * 1.0 # Increase the volume by 5%
292-
surface_area_rv = geometry.surface_area("ENDO_RV")
293292
rvv_init = geo.mesh.comm.allreduce(geometry.volume("ENDO_RV", u=problem.u), op=MPI.SUM) * 1e6 * 1.0 # Increase the volume by 5%
294293
logger.info(f"Initial volume (LV): {lvv_init} mL and (RV): {rvv_init} mL")
295294
init_state = {"V_LV": lvv_initial * 1e6 * mL, "V_RV": rvv_initial * 1e6 * mL}

tests/test_geometry.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import math
22

3+
import gmsh
34
import numpy as np
45
import pytest
56
import ufl
@@ -111,6 +112,7 @@ def test_HeartGeometry_lv(tmp_path):
111112
# assert np.isclose(geo2.volume("ENDO"), endo_volume, atol=1e-7)
112113

113114

115+
@pytest.mark.skipif(gmsh.__version__ == "4.14.0", reason="GMSH 4.14.0 has a bug with fuse")
114116
def test_HeartGeometry_biv(tmp_path):
115117
geo1 = cardiac_geometries.mesh.biv_ellipsoid(
116118
outdir=tmp_path,

0 commit comments

Comments
 (0)