Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Electro-mechanics on a slab

main.py couples EP and mechanics on a 2 × 1 × 0.5 mm slab of tissue. It is tutorial 4 grown into a program: the split, the coupling scheme and the contraction model are chosen on the command line, and the run writes its results for ParaView, checkpoints, and restarts.

The slab is generated with cardiac-geometriesx on first use, into meshes/.

Running

cd examples/slab
python3 main.py                                   # zeta split, monolithic, 40 ms
python3 main.py --odefile ../odefiles/ToRORd_dynCl_endo_caisplit.ode --scheme stabilized
python3 main.py --odefile ../odefiles/ToRORd_dynCl_endo_caisplit.ode \
    --crossbridge Land2017 --scheme stabilized --dt-mech 1
python3 post.py --output-dir output/ToRORd_dynCl_endo_zetasplit
OptionMeaning
--odefileThe .ode file, and so the split (default: the zeta split)
--schememonolithic (default), stabilized or segregated
--crossbridgeLand2017, RDQ18, RDQ20MF or Lewalle2024; needs the Ca_i split and --scheme stabilized or segregated
--sl-refReference sarcomere length in µm (required for RDQ18)
--dt-mech, --t-endMechanics time step and end time, in ms
--output-dirWhere the results go (default output/<odefile stem>/)
--save-every, --save-every-ep, --checkpoint-everyOutput intervals, in ms
--restart, --overwriteContinue from the checkpoint in the output folder, or replace its results
--snapshot-everyField snapshots for the scheme comparison, in ms

Output

In --output-dir:

post.py writes post/: fields.bp (everything on P1, for ParaView), traces at a corner and as volume means, and plots.

A restart may change the run’s length and output options, but not its physics. A restart with another --scheme, for example, is refused.