Running a bidomain simulation with a bath and fibres#
In this tutorial we run a bidomain simulation with both a bath and fibres
We include the same headers as in the previous fibre tutorial
Define the test class as before
Bath problems seem to require decreased ODE timesteps. We use the
Backward Euler version of the Luo-Rudy model (see below) instead to
improve code performance.
Use the PlaneStimulusCellFactory to define a set of Luo-Rudy cells, in this
case with a Backward Euler solver. We pass the stimulus magnitude as 0.0
as we don’t want any stimulated cells.
Note that in the previous bath example, a mesh was read in and elements where then set to be
bath elements in the test. With fibres as well, in a bath simulation, it is better to read in a
mesh that has all the information: this mesh has bath elements defined as an extra column in the
.ele file, and a .ortho file which defines the fibre direction for each element. Note that the
.ortho file should include fibre information for bath elements as well, but they won’t be used
in the simulation. (The fibres read here are the same ‘kinked’ fibres as in the previous fibre
tutorial).
Set anistropic conductivities.
and now we define the electrodes..
Now create the problem class, using the cell factory and passing
in true as the second argument to indicate we are solving a bath
problem, and solve.