Cardiac electro-mechanics in FEniCSx.
simcardemsx couples a model of cardiac electrophysiology (EP) to a model of tissue mechanics, with the contraction of each cell in between. It connects two solvers:
fenicsx-beat for EP (the monodomain model);
fenicsx-pulse for the mechanics, from a single element to a beating heart in a circulation model.
The cell model, EP and contraction alike, is a single
gotranx .ode file. simcardemsx splits it in two
and generates code for each half: NumPy for EP, and UFL for the contraction, so that the
contraction model can be stepped inside the mechanics Newton iteration. That removes
the instability the usual staggered coupling suffers from when the tissue is soft.
Where to start¶
Get DOLFINx and install simcardemsx.
From one cell to a coupled slab, in four steps.
How the pieces fit together, and the models behind them.
Every module, class and function.
Features¶
One
.odefile for the whole cell, split anywhere between EP and contraction. Which variables cross between the two sides is read off the generated code, not configured by hand.Separate meshes and time steps for EP and mechanics.
Three coupling schemes: monolithic (the default), stabilized segregated, and the naive segregated scheme for comparison.
Static and dynamic mechanics, closed-loop circulation and open-loop cardiac cycles, through pulse.
Rollback of a failed time step, and checkpoints that a run continues from in a new process.