|
85 | 85 | robin_base = pulse.RobinBC(value=alpha_base, marker=geometry.markers["BASE"][0]) |
86 | 86 |
|
87 | 87 |
|
88 | | -lvv_initial = geometry.volume("ENDO_LV") |
| 88 | +lvv_initial = geo.mesh.comm.allreduce(geometry.volume("ENDO_LV"), op=MPI.SUM) |
89 | 89 | lv_volume = dolfinx.fem.Constant(geometry.mesh, dolfinx.default_scalar_type(lvv_initial)) |
90 | 90 | lv_cavity = pulse.problem.Cavity(marker="ENDO_LV", volume=lv_volume) |
91 | 91 |
|
92 | | -rvv_initial = geometry.volume("ENDO_RV") |
| 92 | +rvv_initial = geo.mesh.comm.allreduce(geometry.volume("ENDO_RV"), op=MPI.SUM) |
93 | 93 | rv_volume = dolfinx.fem.Constant(geometry.mesh, dolfinx.default_scalar_type(rvv_initial)) |
94 | 94 | rv_cavity = pulse.problem.Cavity(marker="ENDO_RV", volume=rv_volume) |
95 | 95 |
|
@@ -179,7 +179,8 @@ def solve_beat(times, states, dt, p, V_index, Ca_index, Vs, Cais, Tas): |
179 | 179 | ax[2, 1].set_xlabel("Time [ms]") |
180 | 180 |
|
181 | 181 | fig.savefig(outdir / "Ta_ORdLand.png") |
182 | | - np.save(state_file, y) |
| 182 | + if comm.rank == 0: |
| 183 | + np.save(state_file, y) |
183 | 184 |
|
184 | 185 | y = np.load(state_file) |
185 | 186 |
|
@@ -287,9 +288,7 @@ def p_BiV_func(V_LV, V_RV, t): |
287 | 288 |
|
288 | 289 | mL = circulation.units.ureg("mL") |
289 | 290 | add_units = False |
290 | | -surface_area_lv = geometry.surface_area("ENDO_LV") |
291 | 291 | 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") |
293 | 292 | rvv_init = geo.mesh.comm.allreduce(geometry.volume("ENDO_RV", u=problem.u), op=MPI.SUM) * 1e6 * 1.0 # Increase the volume by 5% |
294 | 293 | logger.info(f"Initial volume (LV): {lvv_init} mL and (RV): {rvv_init} mL") |
295 | 294 | init_state = {"V_LV": lvv_initial * 1e6 * mL, "V_RV": rvv_initial * 1e6 * mL} |
|
0 commit comments