CEPS  24.01
Cardiac ElectroPhysiology Simulator
IonicSolver Class Reference

Detailed Description

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...
 
CepsRealgetStates () const
 Get pointer on state vars for testing purposes. More...
 
CepsRealgetDtv () 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

AbstractIonicModelm_model
 Link to ionic model equations. More...
 
EvolFunctionm_fLin
 Evolution function (linear part -1/tau) More...
 
EvolFunctionm_fNLin
 Evolution function (non linear part winf/tau + others) More...
 
AbstractDiscretizationm_sDiscr
 Link to spatial discretization. More...
 
AbstractOdeSolverm_solver
 internal ODE solver More...
 
CepsRealm_y
 Values of state variables. More...
 
CepsRealm_dtyLin
 Linear part of rates. More...
 
CepsRealm_dtyNLin
 Non-linear part of rates. More...
 
CepsRealm_v
 Transmembrane voltage. More...
 
CepsRealm_dtv
 Total ionic current. More...
 
CepsBool m_tauOk
 Flag to avoid to compute tau and winf twice per iteration. More...
 
DHVecPtrm_vPde
 Pointer on pointer with v data from the PDE. More...
 
CepsVector< CepsIndexm_localToGlobal
 Mapping between local index of dof and index in PDE. More...
 
CepsUInt m_size
 Number of dofs for this solver. More...
 

Member Typedef Documentation

◆ EvolFunction

Typedef for evolution functions of the ionic model converted into ceps::Function objects.

Definition at line 50 of file IonicSolver.hpp.

Constructor & Destructor Documentation

◆ IonicSolver()

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

See also
InputParameters

Definition at line 34 of file IonicSolver.cpp.

◆ ~IonicSolver()

IonicSolver::~IonicSolver ( )

Destructor.

Definition at line 71 of file IonicSolver.cpp.

Member Function Documentation

◆ addDtv()

void IonicSolver::addDtv ( DHVecPtr  dtv,
CepsReal  t = 0 
) const

Fills the given distributed vector with values of ionic current from ODE system. Does the unit conversion.

Parameters
[out]dtvvector in which data will be put
[in]ttime for evaluation of Cm, if needed

Definition at line 112 of file IonicSolver.cpp.

◆ computeIndexMapping()

void IonicSolver::computeIndexMapping ( )
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.

◆ computeModelRates()

void IonicSolver::computeModelRates ( CepsReal  t,
CepsReal y 
)
protected

Computes the evolution function and ionic current on all dofs, calls the model.

Definition at line 274 of file IonicSolver.cpp.

◆ computeRatesLin()

void IonicSolver::computeRatesLin ( CepsReal  t,
CepsReal w,
CepsReal dtw,
CepsUInt  n 
)
protected

Call the linear part of evolution function of the model.

Definition at line 298 of file IonicSolver.cpp.

◆ computeRatesNonLin()

void IonicSolver::computeRatesNonLin ( CepsReal  t,
CepsReal w,
CepsReal dtw,
CepsUInt  n 
)
protected

Get the non linear part of evolution function of the model.

Definition at line 306 of file IonicSolver.cpp.

◆ createSolvers()

void IonicSolver::createSolvers ( CepsString  opts)
protected

Instantiates ODE solvers from options.

Definition at line 177 of file IonicSolver.cpp.

◆ fillPdeVm()

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.

◆ getDtv()

CepsReal * IonicSolver::getDtv ( ) const

Get pointer on ionic current for testing purposes.

Definition at line 149 of file IonicSolver.cpp.

◆ getNbMultiSteps()

CepsUInt IonicSolver::getNbMultiSteps ( ) const

Number of multi steps of the inner solver.

Definition at line 155 of file IonicSolver.cpp.

◆ getStates()

CepsReal * IonicSolver::getStates ( ) const

Get pointer on state vars for testing purposes.

Definition at line 143 of file IonicSolver.cpp.

◆ getVm()

CepsReal IonicSolver::getVm ( CepsBool  convert) const

Get TMV for testing purposes.

Definition at line 135 of file IonicSolver.cpp.

◆ initializeSolver()

void IonicSolver::initializeSolver ( )
protected

Set the initial conditions and required intermediate arrays of the ODE solvers.

Definition at line 245 of file IonicSolver.cpp.

◆ setActionPotential()

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.

◆ takeOneStep()

void IonicSolver::takeOneStep ( CepsReal  t,
CepsReal  dt,
DHVecPtr  vPde 
)

Advance the ODE system by one full step each (not substep)

Definition at line 96 of file IonicSolver.cpp.

◆ takeOneSubStep()

void IonicSolver::takeOneSubStep ( CepsReal  t,
CepsReal  dt,
DHVecPtr  vPde 
)

Advance the ODE system by one sub step (for RK solvers)

Definition at line 104 of file IonicSolver.cpp.

Field Documentation

◆ m_dtv

CepsReal* IonicSolver::m_dtv
protected

Total ionic current.

Definition at line 158 of file IonicSolver.hpp.

◆ m_dtyLin

CepsReal* IonicSolver::m_dtyLin
protected

Linear part of rates.

Definition at line 155 of file IonicSolver.hpp.

◆ m_dtyNLin

CepsReal* IonicSolver::m_dtyNLin
protected

Non-linear part of rates.

Definition at line 156 of file IonicSolver.hpp.

◆ m_fLin

EvolFunction* IonicSolver::m_fLin
protected

Evolution function (linear part -1/tau)

Definition at line 145 of file IonicSolver.hpp.

◆ m_fNLin

EvolFunction* IonicSolver::m_fNLin
protected

Evolution function (non linear part winf/tau + others)

Definition at line 146 of file IonicSolver.hpp.

◆ m_localToGlobal

CepsVector<CepsIndex> IonicSolver::m_localToGlobal
protected

Mapping between local index of dof and index in PDE.

Definition at line 165 of file IonicSolver.hpp.

◆ m_model

AbstractIonicModel* IonicSolver::m_model
protected

Link to ionic model equations.

Definition at line 144 of file IonicSolver.hpp.

◆ m_sDiscr

AbstractDiscretization* IonicSolver::m_sDiscr
protected

Link to spatial discretization.

Definition at line 149 of file IonicSolver.hpp.

◆ m_size

CepsUInt IonicSolver::m_size
protected

Number of dofs for this solver.

Definition at line 167 of file IonicSolver.hpp.

◆ m_solver

AbstractOdeSolver* IonicSolver::m_solver
protected

internal ODE solver

Definition at line 151 of file IonicSolver.hpp.

◆ m_tauOk

CepsBool IonicSolver::m_tauOk
protected

Flag to avoid to compute tau and winf twice per iteration.

Definition at line 160 of file IonicSolver.hpp.

◆ m_v

CepsReal* IonicSolver::m_v
protected

Transmembrane voltage.

Definition at line 157 of file IonicSolver.hpp.

◆ m_vPde

DHVecPtr* IonicSolver::m_vPde
protected

Pointer on pointer with v data from the PDE.

Definition at line 163 of file IonicSolver.hpp.

◆ m_y

CepsReal* IonicSolver::m_y
protected

Values of state variables.

Definition at line 154 of file IonicSolver.hpp.


The documentation for this class was generated from the following files: