CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
Groups two ODE solvers for ionic variables and interacts with cardiac problem.
The goal of this solver is to return a distributed halo vector with values of the ionic current on the rows of the unknown set in the AbstractIonicModel
Definition at line 43 of file IonicSolver.hpp.
#include <IonicSolver.hpp>
Public Types | |
using | EvolFunction = ceps::Function< void(CepsReal, CepsReal *, CepsReal *, CepsUInt)> |
Typedef for evolution functions of the ionic model converted into ceps::Function objects. More... | |
Public Member Functions | |
IonicSolver (CepsString opts, AbstractIonicModel *m, AbstractDiscretization *discr) | |
Constructor with parameters from input file and ionic model to be linked with The constructor also sets the passed vector of TMV data to the initial values of the ionic model. More... | |
~IonicSolver () | |
Destructor. More... | |
void | setActionPotential (DHVecPtr vPde) |
Copies values of TMV from PDE vector to local array. Call this method prior to takeOneStep or takeOneSubStep. More... | |
void | takeOneStep (CepsReal t, CepsReal dt, DHVecPtr vPde) |
Advance the ODE system by one full step each (not substep) More... | |
void | takeOneSubStep (CepsReal t, CepsReal dt, DHVecPtr vPde) |
Advance the ODE system by one sub step (for RK solvers) More... | |
void | addDtv (DHVecPtr dtv, CepsReal t=0) const |
Fills the given distributed vector with values of ionic current from ODE system. Does the unit conversion. More... | |
void | fillPdeVm (DHVecPtr vPde) const |
Fills the linked PDE vector for vm with current values of m_v. Can be used to get initial condition. More... | |
CepsReal | getVm (CepsBool convert) const |
Get TMV for testing purposes. More... | |
CepsReal * | getStates () const |
Get pointer on state vars for testing purposes. More... | |
CepsReal * | getDtv () const |
Get pointer on ionic current for testing purposes. More... | |
CepsUInt | getNbMultiSteps () const |
Number of multi steps of the inner solver. More... | |
Protected Member Functions | |
void | computeIndexMapping () |
Sets the map from instance-local indices of points to global indices, then allocates arrays and sets initial condition. More... | |
void | createSolvers (CepsString opts) |
Instantiates ODE solvers from options. More... | |
void | initializeSolver () |
Set the initial conditions and required intermediate arrays of the ODE solvers. More... | |
void | computeModelRates (CepsReal t, CepsReal *y) |
Computes the evolution function and ionic current on all dofs, calls the model. More... | |
void | computeRatesLin (CepsReal t, CepsReal *w, CepsReal *dtw, CepsUInt n) |
Call the linear part of evolution function of the model. More... | |
void | computeRatesNonLin (CepsReal t, CepsReal *w, CepsReal *dtw, CepsUInt n) |
Get the non linear part of evolution function of the model. More... | |
Protected Attributes | |
AbstractIonicModel * | m_model |
Link to ionic model equations. More... | |
EvolFunction * | m_fLin |
Evolution function (linear part -1/tau) More... | |
EvolFunction * | m_fNLin |
Evolution function (non linear part winf/tau + others) More... | |
AbstractDiscretization * | m_sDiscr |
Link to spatial discretization. More... | |
AbstractOdeSolver * | m_solver |
internal ODE solver More... | |
CepsReal * | m_y |
Values of state variables. More... | |
CepsReal * | m_dtyLin |
Linear part of rates. More... | |
CepsReal * | m_dtyNLin |
Non-linear part of rates. More... | |
CepsReal * | m_v |
Transmembrane voltage. More... | |
CepsReal * | m_dtv |
Total ionic current. More... | |
CepsBool | m_tauOk |
Flag to avoid to compute tau and winf twice per iteration. More... | |
DHVecPtr * | m_vPde |
Pointer on pointer with v data from the PDE. More... | |
CepsVector< CepsIndex > | m_localToGlobal |
Mapping between local index of dof and index in PDE. More... | |
CepsUInt | m_size |
Number of dofs for this solver. More... | |
using IonicSolver::EvolFunction = ceps::Function<void(CepsReal,CepsReal*,CepsReal*,CepsUInt)> |
Typedef for evolution functions of the ionic model converted into ceps::Function objects.
Definition at line 50 of file IonicSolver.hpp.
IonicSolver::IonicSolver | ( | CepsString | opts, |
AbstractIonicModel * | m, | ||
AbstractDiscretization * | discr | ||
) |
Constructor with parameters from input file and ionic model to be linked with The constructor also sets the passed vector of TMV data to the initial values of the ionic model.
See Ionic Models for information on available parameters
Definition at line 34 of file IonicSolver.cpp.
IonicSolver::~IonicSolver | ( | ) |
Destructor.
Definition at line 71 of file IonicSolver.cpp.
Fills the given distributed vector with values of ionic current from ODE system. Does the unit conversion.
[out] | dtv | vector in which data will be put |
[in] | t | time for evaluation of Cm, if needed |
Definition at line 112 of file IonicSolver.cpp.
|
protected |
Sets the map from instance-local indices of points to global indices, then allocates arrays and sets initial condition.
Definition at line 163 of file IonicSolver.cpp.
Computes the evolution function and ionic current on all dofs, calls the model.
Definition at line 274 of file IonicSolver.cpp.
|
protected |
Call the linear part of evolution function of the model.
Definition at line 298 of file IonicSolver.cpp.
|
protected |
Get the non linear part of evolution function of the model.
Definition at line 306 of file IonicSolver.cpp.
|
protected |
Instantiates ODE solvers from options.
Definition at line 177 of file IonicSolver.cpp.
void IonicSolver::fillPdeVm | ( | DHVecPtr | vPde | ) | const |
Fills the linked PDE vector for vm with current values of m_v. Can be used to get initial condition.
Definition at line 126 of file IonicSolver.cpp.
CepsReal * IonicSolver::getDtv | ( | ) | const |
Get pointer on ionic current for testing purposes.
Definition at line 149 of file IonicSolver.cpp.
CepsUInt IonicSolver::getNbMultiSteps | ( | ) | const |
Number of multi steps of the inner solver.
Definition at line 155 of file IonicSolver.cpp.
CepsReal * IonicSolver::getStates | ( | ) | const |
Get pointer on state vars for testing purposes.
Definition at line 143 of file IonicSolver.cpp.
Get TMV for testing purposes.
Definition at line 135 of file IonicSolver.cpp.
|
protected |
Set the initial conditions and required intermediate arrays of the ODE solvers.
Definition at line 245 of file IonicSolver.cpp.
void IonicSolver::setActionPotential | ( | DHVecPtr | vPde | ) |
Copies values of TMV from PDE vector to local array. Call this method prior to takeOneStep or takeOneSubStep.
Definition at line 86 of file IonicSolver.cpp.
Advance the ODE system by one full step each (not substep)
Definition at line 96 of file IonicSolver.cpp.
Advance the ODE system by one sub step (for RK solvers)
Definition at line 104 of file IonicSolver.cpp.
|
protected |
Total ionic current.
Definition at line 158 of file IonicSolver.hpp.
|
protected |
Linear part of rates.
Definition at line 155 of file IonicSolver.hpp.
|
protected |
Non-linear part of rates.
Definition at line 156 of file IonicSolver.hpp.
|
protected |
Evolution function (linear part -1/tau)
Definition at line 145 of file IonicSolver.hpp.
|
protected |
Evolution function (non linear part winf/tau + others)
Definition at line 146 of file IonicSolver.hpp.
|
protected |
Mapping between local index of dof and index in PDE.
Definition at line 165 of file IonicSolver.hpp.
|
protected |
Link to ionic model equations.
Definition at line 144 of file IonicSolver.hpp.
|
protected |
Link to spatial discretization.
Definition at line 149 of file IonicSolver.hpp.
|
protected |
Number of dofs for this solver.
Definition at line 167 of file IonicSolver.hpp.
|
protected |
internal ODE solver
Definition at line 151 of file IonicSolver.hpp.
|
protected |
Flag to avoid to compute tau and winf twice per iteration.
Definition at line 160 of file IonicSolver.hpp.
|
protected |
Transmembrane voltage.
Definition at line 157 of file IonicSolver.hpp.
|
protected |
Pointer on pointer with v data from the PDE.
Definition at line 163 of file IonicSolver.hpp.
|
protected |
Values of state variables.
Definition at line 154 of file IonicSolver.hpp.