ChasteGuides/SolvingCardiacProblems

Solving a cardiac problem

This page gives a high-level overview of the code execution flow when solving a cardiac problem. To run simulations, see UserTutorials. For an overview of the PDE solver hierarchy, see FiniteElementAssemblersAndSolvers. The steps that occur are as follows


The Solve method on AbstractDynamicLinearPdeSolver does the following, for each PDE timestep


1. PrepareForLinearSystem is where the cell models are solved. It is implemented in AbstractMonodomainSolver/AbstractBidomainSolver, where it just calls SolveCellSystems on the MonodomainTissue/BidomainTissue. This is implemented in AbstractCardiacTissue::SolveCellSystems, which essentially does the following for each cell:

  1. Set V from the current PDE solution
  2. Call the cell's ComputeExceptVoltage to solve for all state variables except V until the next PDE time step
  3. Call UpdateCaches. This calls the cell's GetIIonic to compute the I_ion term and stores it in mIionicCacheReplicated (replicated over each process so no parallel communication is required later). It similarly also calculates and caches the intracellular stimulus at each cell.

2. SetupLinearSystem uses any assemblers it has to set up the linear system Ax=b that will be solved that timestep. A is just assembled once the first timestep. For b the solver (or its assemblers) will require the ionic current and stimulus at each cell; this is obtained by calling, for example, mpMonodomainTissue->rGetIionicCacheReplicated()[index]. For more details on setting up b and the method SetupLinearSystem see FiniteElementAssemblersAndSolvers.