88 res += stim->getValue(x,t);
102 "Requesting name of state variable #" << i <<
" of ionic model which has " <<
m_nStateVars
162 ceps::HoldsAttributes(attrs),
164 m_constants (nullptr),
165 m_dconstants(nullptr),
171 "Pointer to unknown is null"
187 return 1/(2.+std::expm1((v-c)/k));
193 return std::exp(-std::pow(v-c,2)/s);
199 if (std::abs(u)<std::numeric_limits<CepsReal>::epsilon()*1.e2)
202 return u/std::expm1(u);
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::basic_string< CepsChar > CepsString
C++ format string.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
CepsReal gaussian(CepsReal x, CepsReal c, CepsReal s) const
Function often used in rates evaluations.
Unknown * getUnknown() const
The unknown object of the transmembrane voltage.
IonicSolver * getLinkedSolver() const
Get link to solver.
IonicSolver * m_solver
Link to solver, set when solver is created.
CepsReal m_paperStim
Original stim amplitude.
ScalarField< DegreeOfFreedom > * m_cm
Link to coef Cm of the PDE, for unit conversion.
virtual CepsReal convertDtvToCepsUnit(const CepsReal &dtv) const
Convert current from ionic model units to ceps units (mV ms-1). Does nothing by default.
ScalarField< DegreeOfFreedom > * getCm() const
Link to Cm coefficient of PDE.
CepsString getName() const
Name of the solver for info display.
virtual CepsReal convertCmFromCepsUnit(const CepsReal &cm) const
Convert capacitance from ceps units (uF/cm2) to ionic model units. Does nothing by default.
CepsReal * m_dconstants
Constant parameters of the model, computed from others.
CepsUInt m_nStateVars
Dimensionality of the ODE system, -1 for vm.
virtual CepsReal convertCurrentFromCepsUnit(const CepsReal &i) const
Convert current from ionic model units to ceps units (uA per cm2). Does nothing by default.
virtual CepsReal convertCmToCepsUnit(const CepsReal &cm) const
Convert capacitance from ionic model units to ceps units (uF/cm2). Does nothing by default.
CepsReal * m_constants
Constant parameters of the model, from inputs.
virtual CepsUInt getNbStateVariables() const
The number of state variables, except transmembrane voltage.
AbstractIonicModel(Unknown *u, const CepsSet< CepsAttribute > &attrs={})
Called only by derived classes.
CepsReal getStimulation(DegreeOfFreedom *x, CepsReal t) const
Get the sum of all stimulations at time t and dof x.
CepsReal uOverExpm1u(CepsReal u) const
Functions u/(1-exp(u)) that returns 2 (from expansion around 0)
CepsVector< CepsString > m_stateVarNames
Names of state variables.
virtual CepsReal convertVoltageToCepsUnit(const CepsReal &v) const
Convert voltage from ionic model units to ceps units (mV). Does nothing by default.
CepsReal getCmInternal(CepsReal t, DegreeOfFreedom *dof) const
Get either the value of cm on dof, or the default value from the paper.
CepsReal getPaperStim() const
Get the original amplitude of stimulation, converted into ceps units.
Unknown * m_unknown
Pointer on unknown on which the model applies.
virtual ~AbstractIonicModel()
Destructor.
void addStimulation(ScalarSourceTerm *stim)
Links the model to a stimulation function, needed for computation of _ki.
CepsReal getPaperCm(CepsBool cepsUnit) const
Get the original value of Cm used in paper.
CepsVector< ScalarSourceTerm * > m_stims
Link to excitations.
void setCm(ScalarField< DegreeOfFreedom > *)
Link to Cm coefficient of PDE.
CepsString getStateVariableName(CepsUInt i) const
Gives the name of the i-th state variable.
virtual CepsReal convertVoltageFromCepsUnit(const CepsReal &v) const
Convert voltage from ceps units (mV) to ionic model units. Does nothing by default.
CepsReal m_paperCm
Original value of Cm.
CepsReal sigmoid(CepsReal x, CepsReal c, CepsReal k) const
Function often used in rates evaluations.
CepsString m_name
A label for display.
void setLinkedSolver(IonicSolver *solver)
Links instance to solver.
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
A Field is an object wrapped around a SAFunc functor, defined on at least one domain.
Groups two ODE solvers for ionic variables and interacts with cardiac problem.
Source term, essentially a ScalarField.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
A namespace for all utility methods.
void destroyTabular(_Type &)
Destroy[delete] any type.
CepsBool isNullPtr(_Type *ptr)
Tells if passed pointer is null.