#include <AbstractCardiacCellInterface.hpp>
Public Member Functions | |
AbstractCardiacCellInterface (boost::shared_ptr< AbstractIvpOdeSolver > pOdeSolver, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus) | |
virtual | ~AbstractCardiacCellInterface () |
virtual void | ResetToInitialConditions ()=0 |
virtual OdeSolution | Compute (double tStart, double tEnd, double tSamp=0.0)=0 |
virtual void | ComputeExceptVoltage (double tStart, double tEnd)=0 |
virtual double | GetIIonic ()=0 |
virtual void | SetVoltage (double voltage)=0 |
virtual double | GetVoltage ()=0 |
unsigned | GetVoltageIndex () |
void | SetStimulusFunction (boost::shared_ptr< AbstractStimulusFunction > pStimulus) |
double | GetStimulus (double time) |
void | SetIntracellularStimulusFunction (boost::shared_ptr< AbstractStimulusFunction > pStimulus) |
double | GetIntracellularStimulus (double time) |
double | GetIntracellularAreaStimulus (double time) |
void | SetUsedInTissueSimulation (bool tissue=true) |
virtual void | UseCellMLDefaultStimulus () |
bool | HasCellMLDefaultStimulus () |
virtual void | VerifyStateVariables () |
boost::shared_ptr < AbstractStimulusFunction > | GetStimulusFunction () |
const boost::shared_ptr < AbstractStimulusFunction > | GetStimulusFunction () const |
const boost::shared_ptr < AbstractIvpOdeSolver > | GetSolver () const |
Protected Attributes | |
unsigned | mVoltageIndex |
boost::shared_ptr < AbstractIvpOdeSolver > | mpOdeSolver |
boost::shared_ptr < AbstractStimulusFunction > | mpIntracellularStimulus |
bool | mSetVoltageDerivativeToZero |
bool | mIsUsedInTissue |
bool | mHasDefaultStimulusFromCellML |
Private Member Functions | |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
Friends | |
class | boost::serialization::access |
Strictly speaking this isn't an interface, since some methods have implementations defined. But the name AbstractCardiacCell was already taken.
Note that serialization is not defined for this class. AbstractCvodeCell does not have (or need) serialization at present, so adding serialization here would break archive backwards compatibility for little gain.
Definition at line 53 of file AbstractCardiacCellInterface.hpp.
AbstractCardiacCellInterface::AbstractCardiacCellInterface | ( | boost::shared_ptr< AbstractIvpOdeSolver > | pOdeSolver, | |
unsigned | voltageIndex, | |||
boost::shared_ptr< AbstractStimulusFunction > | pIntracellularStimulus | |||
) |
Create a new cardiac cell. The state variables of the cell will be set to AbstractOdeSystemInformation::GetInitialConditions(). Note that calls to SetDefaultInitialConditions() on a particular instance of this class will not modify its state variables. You can modify them directly with rGetStateVariables().
pOdeSolver | the ODE solver to use when simulating this cell (ignored for some subclasses; can be an empty pointer in these cases) | |
voltageIndex | the index of the transmembrane potential within the vector of state variables | |
pIntracellularStimulus | the intracellular stimulus current |
Definition at line 35 of file AbstractCardiacCellInterface.cpp.
AbstractCardiacCellInterface::~AbstractCardiacCellInterface | ( | ) | [virtual] |
Virtual destructor
Definition at line 49 of file AbstractCardiacCellInterface.cpp.
virtual void AbstractCardiacCellInterface::ResetToInitialConditions | ( | ) | [pure virtual] |
Reset the model's state variables to the default initial conditions.
Implemented in AbstractCardiacCell, and AbstractCvodeCell.
virtual OdeSolution AbstractCardiacCellInterface::Compute | ( | double | tStart, | |
double | tEnd, | |||
double | tSamp = 0.0 | |||
) | [pure virtual] |
Simulates this cell's behaviour between the time interval [tStart, tEnd], and return state variable values. The timestep used will depend on the subclass implementation.
tStart | beginning of the time interval to simulate | |
tEnd | end of the time interval to simulate | |
tSamp | sampling interval for returned results (defaults to dt) |
Implemented in AbstractBackwardEulerCardiacCell< SIZE >, AbstractCardiacCell, and AbstractCvodeCell.
virtual void AbstractCardiacCellInterface::ComputeExceptVoltage | ( | double | tStart, | |
double | tEnd | |||
) | [pure virtual] |
Simulates this cell's behaviour between the time interval [tStart, tEnd], but does not update the voltage. The timestep used will depend on the subclass implementation.
tStart | beginning of the time interval to simulate | |
tEnd | end of the time interval to simulate |
Implemented in AbstractBackwardEulerCardiacCell< SIZE >, AbstractCardiacCell, AbstractCvodeCell, and FakeBathCell.
virtual double AbstractCardiacCellInterface::GetIIonic | ( | ) | [pure virtual] |
Computes the total current flowing through the cell membrane, using the current values of the state variables.
Should return a value in units of microamps/cm^2. Note that many cell models do not use these dimensions (let alone these units) and so a complex conversion is required. There are 2 main cases:
Chaste's value for C_m can be obtained from HeartConfig::Instance()->GetCapacitance() and is measured in uF/cm^2.
Implemented in FakeBathCell, FitzHughNagumo1961OdeSystem, and CML_noble_varghese_kohl_noble_1998_basic_with_sac.
virtual void AbstractCardiacCellInterface::SetVoltage | ( | double | voltage | ) | [pure virtual] |
Set the transmembrane potential
voltage | new value |
Implemented in AbstractCardiacCell, and AbstractCvodeCell.
virtual double AbstractCardiacCellInterface::GetVoltage | ( | ) | [pure virtual] |
Get the current value of the transmembrane potential, as given in our state variable vector.
Implemented in AbstractCardiacCell, and AbstractCvodeCell.
unsigned AbstractCardiacCellInterface::GetVoltageIndex | ( | ) |
Get the index of the transmembrane potential within our state variable vector.
Definition at line 54 of file AbstractCardiacCellInterface.cpp.
References mVoltageIndex.
void AbstractCardiacCellInterface::SetStimulusFunction | ( | boost::shared_ptr< AbstractStimulusFunction > | pStimulus | ) |
Set the intracellular stimulus. Shorthand for SetIntracellularStimulusFunction.
pStimulus | new stimulus function |
Definition at line 60 of file AbstractCardiacCellInterface.cpp.
References SetIntracellularStimulusFunction().
double AbstractCardiacCellInterface::GetStimulus | ( | double | time | ) |
Get the value of the intracellular stimulus. Shorthand for GetIntracellularStimulus.
time | the time at which to evaluate the stimulus |
Definition at line 66 of file AbstractCardiacCellInterface.cpp.
References GetIntracellularStimulus().
Referenced by CML_noble_varghese_kohl_noble_1998_basic_with_sac::EvaluateYDerivatives(), and FitzHughNagumo1961OdeSystem::EvaluateYDerivatives().
void AbstractCardiacCellInterface::SetIntracellularStimulusFunction | ( | boost::shared_ptr< AbstractStimulusFunction > | pStimulus | ) |
Set the intracellular stimulus. This should have units of uA/cm^2 for single-cell problems, or uA/cm^3 in a tissue simulation.
pStimulus | new stimulus function |
Definition at line 72 of file AbstractCardiacCellInterface.cpp.
References mpIntracellularStimulus.
Referenced by HeartConfigRelatedCellFactory< SPACE_DIM >::SetCellIntracellularStimulus(), and SetStimulusFunction().
double AbstractCardiacCellInterface::GetIntracellularStimulus | ( | double | time | ) |
Get the value of the intracellular stimulus. This will have units of uA/cm^2 for single-cell problems, or uA/cm^3 in a tissue simulation.
time | the time at which to evaluate the stimulus |
Definition at line 78 of file AbstractCardiacCellInterface.cpp.
References mpIntracellularStimulus.
Referenced by GetIntracellularAreaStimulus(), and GetStimulus().
double AbstractCardiacCellInterface::GetIntracellularAreaStimulus | ( | double | time | ) |
Get the value of the intracellular stimulus. This will always be in units of uA/cm^2.
time | the time at which to evaluate the stimulus |
Definition at line 84 of file AbstractCardiacCellInterface.cpp.
References GetIntracellularStimulus(), HeartConfig::GetSurfaceAreaToVolumeRatio(), HeartConfig::Instance(), and mIsUsedInTissue.
void AbstractCardiacCellInterface::SetUsedInTissueSimulation | ( | bool | tissue = true |
) |
Set whether this cell object exists in the context of a tissue simulation, or can be used for single cell simulations. This affects the units of the intracellular stimulus (see GetIntracellularStimulus) and so is used by GetIntracellularAreaStimulus to perform a units conversion if necessary.
tissue | true if cell is in a tissue |
Definition at line 99 of file AbstractCardiacCellInterface.cpp.
References mIsUsedInTissue.
void AbstractCardiacCellInterface::UseCellMLDefaultStimulus | ( | ) | [virtual] |
Use CellML metadata to set up the default stimulus for this cell. By default this method will always throw an exception. For suitably annotated models, PyCml will override this to provide a RegularStimulus as defined in the CellML.
Definition at line 104 of file AbstractCardiacCellInterface.cpp.
References EXCEPTION, and mHasDefaultStimulusFromCellML.
bool AbstractCardiacCellInterface::HasCellMLDefaultStimulus | ( | ) |
Definition at line 110 of file AbstractCardiacCellInterface.cpp.
References mHasDefaultStimulusFromCellML.
virtual void AbstractCardiacCellInterface::VerifyStateVariables | ( | ) | [inline, virtual] |
Empty method which can be over-ridden in concrete cell class which should go through the current state vector and go range checking on the values (eg check that concentrations are positive and gating variables are between zero and one). This method is called in the ComputeExceptVoltage method.
Reimplemented in AbstractCardiacCell.
Definition at line 207 of file AbstractCardiacCellInterface.hpp.
Referenced by AbstractCvodeCell::Solve().
boost::shared_ptr< AbstractStimulusFunction > AbstractCardiacCellInterface::GetStimulusFunction | ( | ) |
Definition at line 115 of file AbstractCardiacCellInterface.cpp.
References mpIntracellularStimulus.
const boost::shared_ptr< AbstractStimulusFunction > AbstractCardiacCellInterface::GetStimulusFunction | ( | ) | const |
For boost archiving use only (that's why the 'consts' are required)
Definition at line 121 of file AbstractCardiacCellInterface.cpp.
References mpIntracellularStimulus.
const boost::shared_ptr< AbstractIvpOdeSolver > AbstractCardiacCellInterface::GetSolver | ( | ) | const |
For boost archiving use only (that's why the 'consts' are required)
Definition at line 126 of file AbstractCardiacCellInterface.cpp.
References mpOdeSolver.
void AbstractCardiacCellInterface::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
This is needed to register the base-derived relationship between this class and AbstractCardiacCell; however, serialization of our members is done by AbstractCardiacCell in order to maintain archive backwards compatibility more easily, since we never archive AbstractCvodeCell s.
archive | ||
version |
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, AbstractCardiacCell, FakeBathCell, and CML_noble_varghese_kohl_noble_1998_basic_with_sac.
Definition at line 269 of file AbstractCardiacCellInterface.hpp.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, AbstractCardiacCell, FakeBathCell, and CML_noble_varghese_kohl_noble_1998_basic_with_sac.
Definition at line 258 of file AbstractCardiacCellInterface.hpp.
unsigned AbstractCardiacCellInterface::mVoltageIndex [protected] |
The index of the voltage within our state variable vector.
Definition at line 235 of file AbstractCardiacCellInterface.hpp.
Referenced by FitzHughNagumo1961OdeSystem::GetIIonic(), AbstractCvodeCell::GetVoltage(), AbstractCardiacCell::GetVoltage(), GetVoltageIndex(), AbstractCvodeCell::SetVoltage(), and AbstractCardiacCell::SetVoltage().
boost::shared_ptr<AbstractIvpOdeSolver> AbstractCardiacCellInterface::mpOdeSolver [protected] |
Pointer to the solver used to simulate this cell.
Definition at line 238 of file AbstractCardiacCellInterface.hpp.
Referenced by AbstractCardiacCell::Compute(), AbstractCardiacCell::ComputeExceptVoltage(), and GetSolver().
boost::shared_ptr<AbstractStimulusFunction> AbstractCardiacCellInterface::mpIntracellularStimulus [protected] |
The intracellular stimulus current.
Definition at line 241 of file AbstractCardiacCellInterface.hpp.
Referenced by GetIntracellularStimulus(), GetStimulusFunction(), and SetIntracellularStimulusFunction().
bool AbstractCardiacCellInterface::mSetVoltageDerivativeToZero [protected] |
Flag set to true if ComputeExceptVoltage is called, to indicate to subclass EvaluateYDerivatives methods that V should be considered fixed, and hence dV/dt set to zero.
Definition at line 248 of file AbstractCardiacCellInterface.hpp.
Referenced by AbstractCardiacCell::ComputeExceptVoltage(), CML_noble_varghese_kohl_noble_1998_basic_with_sac::EvaluateYDerivatives(), FitzHughNagumo1961OdeSystem::EvaluateYDerivatives(), AbstractCardiacCell::serialize(), and AbstractCvodeCell::SetVoltageDerivativeToZero().
bool AbstractCardiacCellInterface::mIsUsedInTissue [protected] |
Whether this cell exists in a tissue, or is an isolated cell.
Definition at line 251 of file AbstractCardiacCellInterface.hpp.
Referenced by GetIntracellularAreaStimulus(), AbstractCardiacCell::serialize(), and SetUsedInTissueSimulation().
bool AbstractCardiacCellInterface::mHasDefaultStimulusFromCellML [protected] |
Whether this cell has a default stimulus specified by CellML metadata
Definition at line 254 of file AbstractCardiacCellInterface.hpp.
Referenced by HasCellMLDefaultStimulus(), AbstractCardiacCell::serialize(), and UseCellMLDefaultStimulus().