CEPS  24.01
Cardiac ElectroPhysiology Simulator
AbstractIonicModel Class Referenceabstract

Detailed Description

Represents a ionic model for a group of cells, i.e. multiple systems of ODEs.

Ionic models are ODE systems with several state variables $Y$ plus the transmembrane voltage $v_\mathrm{m}$.

The evolution function $y'=f(t,y,v)$ can be generally splitted into a linear part and a non linear part $f(t,y,v) = a(t,v)y + b(t,y,v)$.

The computeRates method, which must be defined in derived classes must compute the a and b terms accordingly.

The units of the model may be different of CEPS units. In this case, override the conversion methods.

Definition at line 53 of file AbstractIonicModel.hpp.

#include <AbstractIonicModel.hpp>

Inheritance diagram for AbstractIonicModel:
[legend]

Public Member Functions

virtual ~AbstractIonicModel ()
 Destructor. More...
 
CepsString getName () const
 Name of the solver for info display. More...
 
UnknowngetUnknown () const
 The unknown object of the transmembrane voltage. More...
 
ScalarField< DegreeOfFreedom > * getCm () const
 Link to Cm coefficient of PDE. More...
 
void setCm (ScalarField< DegreeOfFreedom > *)
 Link to Cm coefficient of PDE. More...
 
CepsReal getPaperCm (CepsBool cepsUnit) const
 Get the original value of Cm used in paper. More...
 
CepsReal getPaperStim () const
 Get the original amplitude of stimulation, converted into ceps units. More...
 
void addStimulation (ScalarSourceTerm *stim)
 Links the model to a stimulation function, needed for computation of _ki. More...
 
CepsReal getStimulation (DegreeOfFreedom *x, CepsReal t) const
 Get the sum of all stimulations at time t and dof x. More...
 
virtual CepsUInt getNbStateVariables () const
 The number of state variables, except transmembrane voltage. More...
 
CepsString getStateVariableName (CepsUInt i) const
 Gives the name of the i-th state variable. More...
 
virtual void getInitialCondition (CepsReal *v, CepsReal *y) const =0
 Sets initial values of state variables and transmembrane voltage for a single point. Arrays y,dty must be preallocated with size m_nStateVars. More...
 
virtual void computeRates (CepsReal t, CepsReal *y, CepsReal *v, CepsReal *dtyL, CepsReal *dtyNL, CepsReal *dtv, DegreeOfFreedom *dof) const =0
 Get the linear and non linear part of the evolution function f. Also computes the ionic current. More...
 
virtual CepsReal convertVoltageFromCepsUnit (const CepsReal &v) const
 Convert voltage from ceps units (mV) to ionic model units. Does nothing by default. More...
 
virtual CepsReal convertVoltageToCepsUnit (const CepsReal &v) const
 Convert voltage from ionic model units to ceps units (mV). Does nothing by default. More...
 
virtual CepsReal convertDtvToCepsUnit (const CepsReal &dtv) const
 Convert current from ionic model units to ceps units (mV ms-1). Does nothing by default. More...
 
virtual CepsReal convertCurrentFromCepsUnit (const CepsReal &i) const
 Convert current from ionic model units to ceps units (uA per cm2). Does nothing by default. More...
 
virtual CepsReal convertCmFromCepsUnit (const CepsReal &cm) const
 Convert capacitance from ceps units (uF/cm2) to ionic model units. Does nothing by default. More...
 
virtual CepsReal convertCmToCepsUnit (const CepsReal &cm) const
 Convert capacitance from ionic model units to ceps units (uF/cm2). Does nothing by default. More...
 
void setLinkedSolver (IonicSolver *solver)
 Links instance to solver. More...
 
IonicSolvergetLinkedSolver () const
 Get link to solver. More...
 
- Public Member Functions inherited from ceps::HoldsAttributes
 HoldsAttributes (const CepsSet< CepsAttribute > &attributes)
 Constructor with any number of attributes. More...
 
 HoldsAttributes (const CepsVector< CepsAttribute > &attributes)
 Constructor with any number of attributes. More...
 
 HoldsAttributes (CepsAttribute *attributes, const CepsUInt &n)
 Constructor with any number of attributes. More...
 
 HoldsAttributes ()=default
 Default constructor. More...
 
 HoldsAttributes (const HoldsAttributes &)=default
 Assignement operator. More...
 
 HoldsAttributes (HoldsAttributes &&) noexcept=default
 Copy constructor. More...
 
virtual ~HoldsAttributes ()=default
 Destructor. More...
 
HoldsAttributesoperator= (const HoldsAttributes &)=default
 Assignment operator. More...
 
HoldsAttributesoperator= (HoldsAttributes &&) noexcept=default
 Assignment operator. More...
 
CepsUInt getNumberOfAttributes () const
 Returns number of attributes of the entity. More...
 
CepsSet< CepsAttribute > & getAttributes ()
 Returns the attributes of the entity. More...
 
const CepsSet< CepsAttribute > & getAttributes () const
 Returns the attributes of the entity, const version. More...
 
void setAttributes (const CepsVector< CepsAttribute > &attributes)
 Sets the attributes of the entity. More...
 
void setAttributes (const CepsSet< CepsAttribute > &attributes)
 Sets the attributes of the entity. More...
 
void setAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Sets the attributes of the entity. More...
 
template<class _It >
void setAttributes (_It first, _It last)
 Sets the attributes of the entity. More...
 
void addAttribute (const CepsAttribute &name)
 Adds an attribute to the entity. More...
 
void addAttributes (const CepsVector< CepsAttribute > &attributes)
 Adds several attributes to the entity. More...
 
void addAttributes (const CepsSet< CepsAttribute > &attributes)
 Adds several attributes to the entity. More...
 
void addAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Adds several attributes to the entity. More...
 
template<class _It >
void addAttributes (_It first, _It last)
 Adds several attributes to the entity. More...
 
void removeAttribute (const CepsAttribute &name)
 Removes an attribute from the entity. More...
 
void removeAttributes (const CepsSet< CepsAttribute > &attributes)
 Removes several attributes from the entity. More...
 
void removeAttributes (const CepsVector< CepsAttribute > &attributes)
 Removes several attributes from the entity. More...
 
void removeAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Removes several attributes from the entity. More...
 
template<class _It >
void removeAttributes (_It first, _It last)
 Removes several attributes from the entity. More...
 
void clearAttributes ()
 Removes all attributes from the entity. More...
 
CepsBool hasAttribute (const CepsAttribute &name) const
 Tells if the entity has the attribute in argument. More...
 
CepsBool hasAllAttributes (const CepsVector< CepsAttribute > &attributes) const
 Tells if the entity has all the attributes in argument. More...
 
CepsBool hasAllAttributes (const CepsAttribute *attributes, const CepsUInt &n) const
 Tells if the entity has all the attributes in argument. More...
 
template<class _It >
CepsBool hasAllAttributes (_It first, _It last) const
 Tells if the entity has all the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsSet< CepsAttribute > &attributes) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsVector< CepsAttribute > &attributes) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsAttribute *attributes, const CepsUInt &n) const
 Tells if the entity has one of the attributes in argument. More...
 
template<class _It >
CepsBool hasOneOfAttributes (_It first, _It last) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasUniversalAttribute () const
 Detect if the current entity has the attribute universal. More...
 
void reset ()
 Equivalent to HoldsAttributes::clear() More...
 

Protected Member Functions

 AbstractIonicModel (Unknown *u, const CepsSet< CepsAttribute > &attrs={})
 Called only by derived classes. More...
 
CepsReal getCmInternal (CepsReal t, DegreeOfFreedom *dof) const
 Get either the value of cm on dof, or the default value from the paper. More...
 
CepsReal sigmoid (CepsReal x, CepsReal c, CepsReal k) const
 Function often used in rates evaluations. More...
 
CepsReal gaussian (CepsReal x, CepsReal c, CepsReal s) const
 Function often used in rates evaluations. More...
 
CepsReal uOverExpm1u (CepsReal u) const
 Functions u/(1-exp(u)) that returns 2 (from expansion around 0) More...
 

Protected Attributes

Unknownm_unknown
 Pointer on unknown on which the model applies. More...
 
CepsRealm_constants
 Constant parameters of the model, from inputs. More...
 
CepsRealm_dconstants
 Constant parameters of the model, computed from others. More...
 
ScalarField< DegreeOfFreedom > * m_cm
 Link to coef Cm of the PDE, for unit conversion. More...
 
CepsReal m_paperCm
 Original value of Cm. More...
 
CepsReal m_paperStim
 Original stim amplitude. More...
 
CepsVector< ScalarSourceTerm * > m_stims
 Link to excitations. More...
 
CepsUInt m_nStateVars
 Dimensionality of the ODE system, -1 for vm. More...
 
CepsVector< CepsStringm_stateVarNames
 Names of state variables. More...
 
CepsString m_name
 A label for display. More...
 
IonicSolverm_solver
 Link to solver, set when solver is created. More...
 
- Protected Attributes inherited from ceps::HoldsAttributes
CepsSet< CepsAttributem_attributes
 The attributes held by the entity. More...
 

Constructor & Destructor Documentation

◆ ~AbstractIonicModel()

AbstractIonicModel::~AbstractIonicModel ( )
virtual

Destructor.

Definition at line 32 of file AbstractIonicModel.cpp.

◆ AbstractIonicModel()

AbstractIonicModel::AbstractIonicModel ( Unknown u,
const CepsSet< CepsAttribute > &  attrs = {} 
)
protected

Called only by derived classes.

Definition at line 157 of file AbstractIonicModel.cpp.

Member Function Documentation

◆ addStimulation()

void AbstractIonicModel::addStimulation ( ScalarSourceTerm stim)

Links the model to a stimulation function, needed for computation of _ki.

Definition at line 78 of file AbstractIonicModel.cpp.

◆ computeRates()

virtual void AbstractIonicModel::computeRates ( CepsReal  t,
CepsReal y,
CepsReal v,
CepsReal dtyL,
CepsReal dtyNL,
CepsReal dtv,
DegreeOfFreedom dof 
) const
pure virtual

Get the linear and non linear part of the evolution function f. Also computes the ionic current.

Parameters
[in]ttime $t$
[in]yvalue of state variables at time $t$
[in]vvalue of transmembrane voltage at time $t$
[out]dtyLwill be filled with the linear part of the derivative
[out]dtyNLthe non linear part of the derivative
[out]dtvvalue of ionic current at time $t^n$
[in]dofdegree of freedom, in case some coefficients depend on space

Implemented in ORdmD16, MS03, BR77, TTP06, MS03Modified, CRN98, and AP95.

◆ convertCmFromCepsUnit()

CepsReal AbstractIonicModel::convertCmFromCepsUnit ( const CepsReal cm) const
virtual

Convert capacitance from ceps units (uF/cm2) to ionic model units. Does nothing by default.

Reimplemented in MS03, CRN98, AP95, and BR77.

Definition at line 138 of file AbstractIonicModel.cpp.

◆ convertCmToCepsUnit()

CepsReal AbstractIonicModel::convertCmToCepsUnit ( const CepsReal cm) const
virtual

Convert capacitance from ionic model units to ceps units (uF/cm2). Does nothing by default.

Reimplemented in MS03, CRN98, AP95, and BR77.

Definition at line 132 of file AbstractIonicModel.cpp.

◆ convertCurrentFromCepsUnit()

CepsReal AbstractIonicModel::convertCurrentFromCepsUnit ( const CepsReal i) const
virtual

Convert current from ionic model units to ceps units (uA per cm2). Does nothing by default.

Reimplemented in BR77, MS03, CRN98, and AP95.

Definition at line 126 of file AbstractIonicModel.cpp.

◆ convertDtvToCepsUnit()

CepsReal AbstractIonicModel::convertDtvToCepsUnit ( const CepsReal dtv) const
virtual

Convert current from ionic model units to ceps units (mV ms-1). Does nothing by default.

Reimplemented in MS03, and AP95.

Definition at line 120 of file AbstractIonicModel.cpp.

◆ convertVoltageFromCepsUnit()

CepsReal AbstractIonicModel::convertVoltageFromCepsUnit ( const CepsReal v) const
virtual

Convert voltage from ceps units (mV) to ionic model units. Does nothing by default.

Reimplemented in MS03, and AP95.

Definition at line 114 of file AbstractIonicModel.cpp.

◆ convertVoltageToCepsUnit()

CepsReal AbstractIonicModel::convertVoltageToCepsUnit ( const CepsReal v) const
virtual

Convert voltage from ionic model units to ceps units (mV). Does nothing by default.

Reimplemented in MS03, and AP95.

Definition at line 108 of file AbstractIonicModel.cpp.

◆ gaussian()

CepsReal AbstractIonicModel::gaussian ( CepsReal  x,
CepsReal  c,
CepsReal  s 
) const
protected

Function often used in rates evaluations.

Definition at line 191 of file AbstractIonicModel.cpp.

◆ getCm()

ScalarField< DegreeOfFreedom > * AbstractIonicModel::getCm ( ) const

Link to Cm coefficient of PDE.

Definition at line 52 of file AbstractIonicModel.cpp.

◆ getCmInternal()

CepsReal AbstractIonicModel::getCmInternal ( CepsReal  t,
DegreeOfFreedom dof 
) const
protected

Get either the value of cm on dof, or the default value from the paper.

Definition at line 176 of file AbstractIonicModel.cpp.

◆ getInitialCondition()

virtual void AbstractIonicModel::getInitialCondition ( CepsReal v,
CepsReal y 
) const
pure virtual

Sets initial values of state variables and transmembrane voltage for a single point. Arrays y,dty must be preallocated with size m_nStateVars.

Implemented in TTP06, ORdmD16, MS03, CRN98, BR77, and AP95.

◆ getLinkedSolver()

IonicSolver * AbstractIonicModel::getLinkedSolver ( ) const

Get link to solver.

Definition at line 150 of file AbstractIonicModel.cpp.

◆ getName()

CepsString AbstractIonicModel::getName ( ) const

Name of the solver for info display.

Definition at line 40 of file AbstractIonicModel.cpp.

◆ getNbStateVariables()

CepsUInt AbstractIonicModel::getNbStateVariables ( ) const
virtual

The number of state variables, except transmembrane voltage.

Definition at line 93 of file AbstractIonicModel.cpp.

◆ getPaperCm()

CepsReal AbstractIonicModel::getPaperCm ( CepsBool  cepsUnit) const

Get the original value of Cm used in paper.

Definition at line 64 of file AbstractIonicModel.cpp.

◆ getPaperStim()

CepsReal AbstractIonicModel::getPaperStim ( ) const

Get the original amplitude of stimulation, converted into ceps units.

Definition at line 72 of file AbstractIonicModel.cpp.

◆ getStateVariableName()

CepsString AbstractIonicModel::getStateVariableName ( CepsUInt  i) const

Gives the name of the i-th state variable.

Definition at line 99 of file AbstractIonicModel.cpp.

◆ getStimulation()

CepsReal AbstractIonicModel::getStimulation ( DegreeOfFreedom x,
CepsReal  t 
) const

Get the sum of all stimulations at time t and dof x.

Definition at line 84 of file AbstractIonicModel.cpp.

◆ getUnknown()

Unknown * AbstractIonicModel::getUnknown ( ) const

The unknown object of the transmembrane voltage.

Returns

Definition at line 46 of file AbstractIonicModel.cpp.

◆ setCm()

void AbstractIonicModel::setCm ( ScalarField< DegreeOfFreedom > *  cm)

Link to Cm coefficient of PDE.

Definition at line 58 of file AbstractIonicModel.cpp.

◆ setLinkedSolver()

void AbstractIonicModel::setLinkedSolver ( IonicSolver solver)

Links instance to solver.

Definition at line 144 of file AbstractIonicModel.cpp.

◆ sigmoid()

CepsReal AbstractIonicModel::sigmoid ( CepsReal  x,
CepsReal  c,
CepsReal  k 
) const
protected

Function often used in rates evaluations.

Definition at line 185 of file AbstractIonicModel.cpp.

◆ uOverExpm1u()

CepsReal AbstractIonicModel::uOverExpm1u ( CepsReal  u) const
protected

Functions u/(1-exp(u)) that returns 2 (from expansion around 0)

Definition at line 197 of file AbstractIonicModel.cpp.

Field Documentation

◆ m_cm

ScalarField<DegreeOfFreedom>* AbstractIonicModel::m_cm
protected

Link to coef Cm of the PDE, for unit conversion.

Definition at line 196 of file AbstractIonicModel.hpp.

◆ m_constants

CepsReal* AbstractIonicModel::m_constants
protected

Constant parameters of the model, from inputs.

Definition at line 194 of file AbstractIonicModel.hpp.

◆ m_dconstants

CepsReal* AbstractIonicModel::m_dconstants
protected

Constant parameters of the model, computed from others.

Definition at line 195 of file AbstractIonicModel.hpp.

◆ m_name

CepsString AbstractIonicModel::m_name
protected

A label for display.

Definition at line 202 of file AbstractIonicModel.hpp.

◆ m_nStateVars

CepsUInt AbstractIonicModel::m_nStateVars
protected

Dimensionality of the ODE system, -1 for vm.

Definition at line 200 of file AbstractIonicModel.hpp.

◆ m_paperCm

CepsReal AbstractIonicModel::m_paperCm
protected

Original value of Cm.

Definition at line 197 of file AbstractIonicModel.hpp.

◆ m_paperStim

CepsReal AbstractIonicModel::m_paperStim
protected

Original stim amplitude.

Definition at line 198 of file AbstractIonicModel.hpp.

◆ m_solver

IonicSolver* AbstractIonicModel::m_solver
protected

Link to solver, set when solver is created.

Definition at line 203 of file AbstractIonicModel.hpp.

◆ m_stateVarNames

CepsVector<CepsString> AbstractIonicModel::m_stateVarNames
protected

Names of state variables.

Definition at line 201 of file AbstractIonicModel.hpp.

◆ m_stims

CepsVector<ScalarSourceTerm*> AbstractIonicModel::m_stims
protected

Link to excitations.

Definition at line 199 of file AbstractIonicModel.hpp.

◆ m_unknown

Unknown* AbstractIonicModel::m_unknown
protected

Pointer on unknown on which the model applies.

Definition at line 193 of file AbstractIonicModel.hpp.


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