#include <AbstractCardiacCell.hpp>
Public Member Functions | |
AbstractCardiacCell (boost::shared_ptr< AbstractIvpOdeSolver > pOdeSolver, unsigned numberOfStateVariables, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus) | |
virtual | ~AbstractCardiacCell () |
void | Init () |
virtual OdeSolution | Compute (double tStart, double tEnd) |
virtual void | ComputeExceptVoltage (double tStart, double tEnd) |
virtual double | GetIIonic ()=0 |
void | SetVoltage (double voltage) |
double | GetVoltage () |
unsigned | GetVoltageIndex () |
void | SetStimulusFunction (boost::shared_ptr< AbstractStimulusFunction > pStimulus) |
double | GetStimulus (double time) |
void | SetIntracellularStimulusFunction (boost::shared_ptr< AbstractStimulusFunction > pStimulus) |
double | GetIntracellularStimulus (double time) |
virtual double | GetIntracellularCalciumConcentration () |
virtual void | VerifyStateVariables () |
virtual void | SetState (CellModelState state) |
virtual void | SetSlowValues (const std::vector< double > &rSlowValues) |
virtual void | GetSlowValues (std::vector< double > &rSlowValues) |
virtual bool | IsFastOnly () |
virtual void | AdjustOutOfRangeSlowValues (std::vector< double > &rSlowValues) |
virtual unsigned | GetNumSlowValues () |
const boost::shared_ptr < AbstractStimulusFunction > | GetStimulusFunction () const |
const boost::shared_ptr < AbstractIvpOdeSolver > | GetSolver () const |
Protected Attributes | |
unsigned | mVoltageIndex |
boost::shared_ptr < AbstractIvpOdeSolver > | mpOdeSolver |
double | mDt |
boost::shared_ptr < AbstractStimulusFunction > | mpIntracellularStimulus |
bool | mSetVoltageDerivativeToZero |
Private Member Functions | |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
Friends | |
class | boost::serialization::access |
It is essentially a cardiac-specific wrapper for ODE systems providing an interface which can interact with the Stimulus classes and the voltage in a mono/bidomain simulation.
Concrete classes can be autogenerated from CellML files by the pyCML package, and will automatically inherit from this class.
Definition at line 62 of file AbstractCardiacCell.hpp.
AbstractCardiacCell::AbstractCardiacCell | ( | boost::shared_ptr< AbstractIvpOdeSolver > | pOdeSolver, | |
unsigned | numberOfStateVariables, | |||
unsigned | voltageIndex, | |||
boost::shared_ptr< AbstractStimulusFunction > | pIntracellularStimulus | |||
) |
Create a new cardiac cell.
pOdeSolver | the ODE solver to use when simulating this cell | |
numberOfStateVariables | the size of the ODE system modelling this cell | |
voltageIndex | the index of the transmembrane potential within the vector of state variables | |
pIntracellularStimulus | the intracellular stimulus current |
Definition at line 33 of file AbstractCardiacCell.cpp.
References AbstractOdeSystem::mNumberOfStateVariables.
AbstractCardiacCell::~AbstractCardiacCell | ( | ) | [virtual] |
Virtual destructor
Definition at line 48 of file AbstractCardiacCell.cpp.
void AbstractCardiacCell::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archive the member variables.
archive | ||
version |
Reimplemented from AbstractOdeSystem.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, BackwardEulerFoxModel2002Modified, BackwardEulerLuoRudyIModel1991, LuoRudyIModel1991OdeSystem, AbstractBackwardEulerCardiacCell< 12 >, AbstractBackwardEulerCardiacCell< 1 >, and AbstractBackwardEulerCardiacCell< 3 >.
Definition at line 74 of file AbstractCardiacCell.hpp.
References mDt, and mSetVoltageDerivativeToZero.
void AbstractCardiacCell::Init | ( | ) |
Initialise the cell:
Reimplemented in BackwardEulerLuoRudyIModel1991.
Definition at line 52 of file AbstractCardiacCell.cpp.
References AbstractOdeSystem::GetInitialConditions(), and AbstractOdeSystem::SetStateVariables().
Referenced by BackwardEulerFoxModel2002Modified::BackwardEulerFoxModel2002Modified(), DiFrancescoNoble1985OdeSystem::DiFrancescoNoble1985OdeSystem(), FitzHughNagumo1961OdeSystem::FitzHughNagumo1961OdeSystem(), HodgkinHuxleySquidAxon1952OriginalOdeSystem::HodgkinHuxleySquidAxon1952OriginalOdeSystem(), BackwardEulerLuoRudyIModel1991::Init(), LuoRudyIModel1991OdeSystem::LuoRudyIModel1991OdeSystem(), Mahajan2008OdeSystem::Mahajan2008OdeSystem(), and TenTusscher2006OdeSystem::TenTusscher2006OdeSystem().
OdeSolution AbstractCardiacCell::Compute | ( | double | tStart, | |
double | tEnd | |||
) | [virtual] |
Simulates this cell's behaviour between the time interval [tStart, tEnd], with timestep mDt.
tStart | beginning of the time interval to simulate | |
tEnd | end of the time interval to simulate |
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, AbstractBackwardEulerCardiacCell< 12 >, AbstractBackwardEulerCardiacCell< 1 >, and AbstractBackwardEulerCardiacCell< 3 >.
Definition at line 58 of file AbstractCardiacCell.cpp.
References mDt, mpOdeSolver, and AbstractOdeSystem::rGetStateVariables().
void AbstractCardiacCell::ComputeExceptVoltage | ( | double | tStart, | |
double | tEnd | |||
) | [virtual] |
Simulates this cell's behaviour between the time interval [tStart, tEnd], with timestep mDt, but does not update the voltage.
tStart | beginning of the time interval to simulate | |
tEnd | end of the time interval to simulate |
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, FakeBathCell, AbstractBackwardEulerCardiacCell< 12 >, AbstractBackwardEulerCardiacCell< 1 >, and AbstractBackwardEulerCardiacCell< 3 >.
Definition at line 64 of file AbstractCardiacCell.cpp.
References GetVoltage(), mDt, mpOdeSolver, mSetVoltageDerivativeToZero, SetVoltage(), and VerifyStateVariables().
virtual double AbstractCardiacCell::GetIIonic | ( | ) | [pure virtual] |
Computes the total current flowing through the cell membrane, using the current values of the state variables.
Implemented in BackwardEulerFoxModel2002Modified, BackwardEulerLuoRudyIModel1991, DiFrancescoNoble1985OdeSystem, FakeBathCell, FitzHughNagumo1961OdeSystem, FoxModel2002Modified, HodgkinHuxleySquidAxon1952OriginalOdeSystem, LuoRudyIModel1991OdeSystem, Mahajan2008OdeSystem, and TenTusscher2006OdeSystem.
void AbstractCardiacCell::SetVoltage | ( | double | voltage | ) |
Set the transmembrane potential
voltage | new value |
Definition at line 77 of file AbstractCardiacCell.cpp.
References mVoltageIndex, and AbstractOdeSystem::rGetStateVariables().
Referenced by ComputeExceptVoltage().
double AbstractCardiacCell::GetVoltage | ( | ) |
Get the current value of the transmembrane potential, as given in our state variable vector.
Definition at line 82 of file AbstractCardiacCell.cpp.
References mVoltageIndex, and AbstractOdeSystem::rGetStateVariables().
Referenced by ComputeExceptVoltage().
unsigned AbstractCardiacCell::GetVoltageIndex | ( | ) |
Get the index of the transmembrane potential within our state variable vector.
Definition at line 87 of file AbstractCardiacCell.cpp.
References mVoltageIndex.
void AbstractCardiacCell::SetStimulusFunction | ( | boost::shared_ptr< AbstractStimulusFunction > | pStimulus | ) |
Set the intracellular stimulus. Shorthand for SetIntracellularStimulusFunction.
pStimulus | new stimulus function |
Definition at line 92 of file AbstractCardiacCell.cpp.
References SetIntracellularStimulusFunction().
double AbstractCardiacCell::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 97 of file AbstractCardiacCell.cpp.
References GetIntracellularStimulus().
Referenced by TenTusscher2006OdeSystem::EvaluateYDerivatives(), Mahajan2008OdeSystem::EvaluateYDerivatives(), LuoRudyIModel1991OdeSystem::EvaluateYDerivatives(), HodgkinHuxleySquidAxon1952OriginalOdeSystem::EvaluateYDerivatives(), FoxModel2002Modified::EvaluateYDerivatives(), FitzHughNagumo1961OdeSystem::EvaluateYDerivatives(), DiFrancescoNoble1985OdeSystem::EvaluateYDerivatives(), BackwardEulerLuoRudyIModel1991::UpdateTransmembranePotential(), and BackwardEulerFoxModel2002Modified::UpdateTransmembranePotential().
void AbstractCardiacCell::SetIntracellularStimulusFunction | ( | boost::shared_ptr< AbstractStimulusFunction > | pStimulus | ) |
Set the intracellular stimulus.
pStimulus | new stimulus function |
Definition at line 102 of file AbstractCardiacCell.cpp.
References mpIntracellularStimulus.
Referenced by SetStimulusFunction().
double AbstractCardiacCell::GetIntracellularStimulus | ( | double | time | ) |
Get the value of the intracellular stimulus.
time | the time at which to evaluate the stimulus |
Definition at line 107 of file AbstractCardiacCell.cpp.
References mpIntracellularStimulus.
Referenced by GetStimulus().
double AbstractCardiacCell::GetIntracellularCalciumConcentration | ( | ) | [virtual] |
[Ca_i] is needed for mechanics, so we explcitly have a Get method (rather than use a get by name type method, to avoid inefficiency when using different cells types of cells). This method by defaults throws an exception, so should be implemented in the concrete class if IntracellularCalciumConcentration is one of the state variables
Reimplemented in BackwardEulerLuoRudyIModel1991, and LuoRudyIModel1991OdeSystem.
Definition at line 113 of file AbstractCardiacCell.cpp.
virtual void AbstractCardiacCell::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 BackwardEulerLuoRudyIModel1991, DiFrancescoNoble1985OdeSystem, LuoRudyIModel1991OdeSystem, and TenTusscher2006OdeSystem.
Definition at line 203 of file AbstractCardiacCell.hpp.
Referenced by AbstractBackwardEulerCardiacCell< SIZE >::Compute(), ComputeExceptVoltage(), and AbstractBackwardEulerCardiacCell< SIZE >::ComputeExceptVoltage().
void AbstractCardiacCell::SetState | ( | CellModelState | state | ) | [virtual] |
This should be implemented by fast/slow cardiac cell subclasses, and
state | whether this cell is in fast or slow mode. |
Definition at line 122 of file AbstractCardiacCell.cpp.
void AbstractCardiacCell::SetSlowValues | ( | const std::vector< double > & | rSlowValues | ) | [virtual] |
Set the slow variables. Should only be valid in fast mode.
rSlowValues | values for the slow variables |
Definition at line 127 of file AbstractCardiacCell.cpp.
void AbstractCardiacCell::GetSlowValues | ( | std::vector< double > & | rSlowValues | ) | [virtual] |
Get the current values of the slow variables. Should only be valid in slow mode.
rSlowValues | will be filled in with the values of the slow variables on return. |
Definition at line 132 of file AbstractCardiacCell.cpp.
bool AbstractCardiacCell::IsFastOnly | ( | ) | [virtual] |
Get whether this cell is a fast or slow version.
Definition at line 137 of file AbstractCardiacCell.cpp.
void AbstractCardiacCell::AdjustOutOfRangeSlowValues | ( | std::vector< double > & | rSlowValues | ) | [virtual] |
In a multiscale simulation a cut-down cell model can be run:
rSlowValues | A vector of the slow values for a particular cell after they have been interpolated from nearby coarse cells |
Definition at line 147 of file AbstractCardiacCell.cpp.
unsigned AbstractCardiacCell::GetNumSlowValues | ( | ) | [virtual] |
Get the number of slow variables for the cell model (irrespective of whether in fast or slow mode).
Definition at line 142 of file AbstractCardiacCell.cpp.
const boost::shared_ptr< AbstractStimulusFunction > AbstractCardiacCell::GetStimulusFunction | ( | ) | const |
For boost archiving use only (that's why the 'consts' are required)
Definition at line 154 of file AbstractCardiacCell.cpp.
References mpIntracellularStimulus.
const boost::shared_ptr< AbstractIvpOdeSolver > AbstractCardiacCell::GetSolver | ( | ) | const |
For boost archiving use only (that's why the 'consts' are required)
Definition at line 159 of file AbstractCardiacCell.cpp.
References mpOdeSolver.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractOdeSystem.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, BackwardEulerFoxModel2002Modified, BackwardEulerLuoRudyIModel1991, LuoRudyIModel1991OdeSystem, AbstractBackwardEulerCardiacCell< 12 >, AbstractBackwardEulerCardiacCell< 1 >, and AbstractBackwardEulerCardiacCell< 3 >.
Definition at line 66 of file AbstractCardiacCell.hpp.
unsigned AbstractCardiacCell::mVoltageIndex [protected] |
The index of the voltage within our state variable vector.
Definition at line 87 of file AbstractCardiacCell.hpp.
Referenced by HodgkinHuxleySquidAxon1952OriginalOdeSystem::GetIIonic(), FitzHughNagumo1961OdeSystem::GetIIonic(), GetVoltage(), GetVoltageIndex(), and SetVoltage().
boost::shared_ptr<AbstractIvpOdeSolver> AbstractCardiacCell::mpOdeSolver [protected] |
Pointer to the solver used to simulate this cell.
Definition at line 89 of file AbstractCardiacCell.hpp.
Referenced by Compute(), ComputeExceptVoltage(), and GetSolver().
double AbstractCardiacCell::mDt [protected] |
The timestep to use when simulating this cell. Set from the HeartConfig object.
Definition at line 91 of file AbstractCardiacCell.hpp.
Referenced by Compute(), AbstractBackwardEulerCardiacCell< SIZE >::Compute(), ComputeExceptVoltage(), AbstractBackwardEulerCardiacCell< SIZE >::ComputeExceptVoltage(), BackwardEulerLuoRudyIModel1991::ComputeJacobian(), BackwardEulerLuoRudyIModel1991::ComputeOneStepExceptVoltage(), BackwardEulerFoxModel2002Modified::ComputeOneStepExceptVoltage(), BackwardEulerLuoRudyIModel1991::ComputeResidual(), serialize(), BackwardEulerLuoRudyIModel1991::UpdateTransmembranePotential(), and BackwardEulerFoxModel2002Modified::UpdateTransmembranePotential().
boost::shared_ptr<AbstractStimulusFunction> AbstractCardiacCell::mpIntracellularStimulus [protected] |
The intracellular stimulus current.
Definition at line 93 of file AbstractCardiacCell.hpp.
Referenced by GetIntracellularStimulus(), GetStimulusFunction(), and SetIntracellularStimulusFunction().
bool AbstractCardiacCell::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 100 of file AbstractCardiacCell.hpp.
Referenced by ComputeExceptVoltage(), TenTusscher2006OdeSystem::EvaluateYDerivatives(), Mahajan2008OdeSystem::EvaluateYDerivatives(), LuoRudyIModel1991OdeSystem::EvaluateYDerivatives(), HodgkinHuxleySquidAxon1952OriginalOdeSystem::EvaluateYDerivatives(), FoxModel2002Modified::EvaluateYDerivatives(), FitzHughNagumo1961OdeSystem::EvaluateYDerivatives(), DiFrancescoNoble1985OdeSystem::EvaluateYDerivatives(), and serialize().