#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 () |
void | SetTimestep (double dt) |
virtual void | SolveAndUpdateState (double tStart, double tEnd) |
virtual OdeSolution | Compute (double tStart, double tEnd, double tSamp=0.0) |
virtual void | ComputeExceptVoltage (double tStart, double tEnd) |
void | SetVoltage (double voltage) |
double | GetVoltage () |
virtual double | GetIntracellularCalciumConcentration () |
virtual void | SetStretch (double stretch) |
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 () |
Protected Attributes | |
double | mDt |
Private Member Functions | |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
void | CheckForArchiveFix () |
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 66 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. 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 | |
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 36 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::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 AbstractCardiacCellInterface.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, FakeBathCell, and CML_noble_varghese_kohl_noble_1998_basic_with_sac.
Definition at line 78 of file AbstractCardiacCell.hpp.
References CheckForArchiveFix(), mDt, AbstractCardiacCellInterface::mHasDefaultStimulusFromCellML, AbstractCardiacCellInterface::mIsUsedInTissue, AbstractParameterisedSystem< std::vector< double > >::mParameters, AbstractCardiacCellInterface::mSetVoltageDerivativeToZero, and AbstractParameterisedSystem< std::vector< double > >::rGetParameterNames().
void AbstractCardiacCell::CheckForArchiveFix | ( | ) | [private] |
The Luo-Rudy 1991 model saved in previous Chaste versions had a different ordering of state variables. If we're loading that model, we'll need to permute the state vector. This can't (easily) be done in the LR91 code itself, since that is auto-generated!
Definition at line 113 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::GetNumberOfStateVariables(), AbstractParameterisedSystem< std::vector< double > >::mParameters, AbstractParameterisedSystem< std::vector< double > >::mStateVariables, and AbstractParameterisedSystem< std::vector< double > >::rGetParameterNames().
Referenced by serialize().
void AbstractCardiacCell::Init | ( | ) |
Initialise the cell:
Definition at line 52 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::mParameters, AbstractParameterisedSystem< std::vector< double > >::ResetToInitialConditions(), and AbstractParameterisedSystem< std::vector< double > >::rGetParameterNames().
Referenced by CML_noble_varghese_kohl_noble_1998_basic_with_sac::CML_noble_varghese_kohl_noble_1998_basic_with_sac(), FakeBathCell::FakeBathCell(), and FitzHughNagumo1961OdeSystem::FitzHughNagumo1961OdeSystem().
void AbstractCardiacCell::SetTimestep | ( | double | dt | ) | [virtual] |
Set the timestep to use for simulating this cell.
dt | the timestep |
Implements AbstractCardiacCellInterface.
Definition at line 58 of file AbstractCardiacCell.cpp.
References mDt.
void AbstractCardiacCell::SolveAndUpdateState | ( | double | tStart, | |
double | tEnd | |||
) | [virtual] |
Simulate this cell's behaviour between the time interval [tStart, tEnd], with timestemp mDt, updating the internal state variable values.
tStart | beginning of the time interval to simulate | |
tEnd | end of the time interval to simulate |
Implements AbstractCardiacCellInterface.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >.
Definition at line 63 of file AbstractCardiacCell.cpp.
References mDt, and AbstractCardiacCellInterface::mpOdeSolver.
OdeSolution AbstractCardiacCell::Compute | ( | double | tStart, | |
double | tEnd, | |||
double | tSamp = 0.0 | |||
) | [virtual] |
Simulates this cell's behaviour between the time interval [tStart, tEnd], with timestep mDt, and return state variable values.
tStart | beginning of the time interval to simulate | |
tEnd | end of the time interval to simulate | |
tSamp | sampling interval for returned results (defaults to mDt) |
Implements AbstractCardiacCellInterface.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >.
Definition at line 68 of file AbstractCardiacCell.cpp.
References mDt, AbstractCardiacCellInterface::mpOdeSolver, and AbstractParameterisedSystem< std::vector< double > >::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 |
Implements AbstractCardiacCellInterface.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, and FakeBathCell.
Definition at line 77 of file AbstractCardiacCell.cpp.
References GetVoltage(), mDt, AbstractCardiacCellInterface::mpOdeSolver, AbstractCardiacCellInterface::mSetVoltageDerivativeToZero, SetVoltage(), and VerifyStateVariables().
void AbstractCardiacCell::SetVoltage | ( | double | voltage | ) | [virtual] |
Set the transmembrane potential
voltage | new value |
Implements AbstractCardiacCellInterface.
Definition at line 94 of file AbstractCardiacCell.cpp.
References AbstractCardiacCellInterface::mVoltageIndex, and AbstractParameterisedSystem< std::vector< double > >::SetAnyVariable().
Referenced by ComputeExceptVoltage().
double AbstractCardiacCell::GetVoltage | ( | ) | [virtual] |
Get the current value of the transmembrane potential, as given in our state variable vector.
Implements AbstractCardiacCellInterface.
Definition at line 99 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::GetAnyVariable(), and AbstractCardiacCellInterface::mVoltageIndex.
Referenced by ComputeExceptVoltage().
double AbstractCardiacCell::GetIntracellularCalciumConcentration | ( | ) | [virtual] |
[Ca_i] is needed for mechanics, so we explicitly have a Get method (rather than use a get by name type method, to avoid inefficiency when using different types of cells). This method by default throws an exception, so should be implemented in the concrete class if intracellular (cytosolic) calcium concentration is one of the state variables.
Reimplemented in CML_noble_varghese_kohl_noble_1998_basic_with_sac.
Definition at line 104 of file AbstractCardiacCell.cpp.
References EXCEPTION.
virtual void AbstractCardiacCell::SetStretch | ( | double | stretch | ) | [inline, virtual] |
In electromechanics problems, the stretch is passed back to cell-model in case mechano-electric feedback has been modelled. We define an empty method here. Stretch-dependent cell models should overload this method to use the input stretch accordingly.
stretch | the stretch of the cell in the axial direction |
Reimplemented in CML_noble_varghese_kohl_noble_1998_basic_with_sac.
Definition at line 209 of file AbstractCardiacCell.hpp.
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 from AbstractCardiacCellInterface.
Definition at line 219 of file AbstractCardiacCell.hpp.
Referenced by AbstractBackwardEulerCardiacCell< SIZE >::Compute(), ComputeExceptVoltage(), AbstractBackwardEulerCardiacCell< SIZE >::ComputeExceptVoltage(), and AbstractBackwardEulerCardiacCell< SIZE >::SolveAndUpdateState().
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 139 of file AbstractCardiacCell.cpp.
References EXCEPTION.
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 144 of file AbstractCardiacCell.cpp.
References EXCEPTION.
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 149 of file AbstractCardiacCell.cpp.
References EXCEPTION.
bool AbstractCardiacCell::IsFastOnly | ( | ) | [virtual] |
Get whether this cell is a fast or slow version.
Definition at line 154 of file AbstractCardiacCell.cpp.
References EXCEPTION.
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 164 of file AbstractCardiacCell.cpp.
References EXCEPTION.
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 159 of file AbstractCardiacCell.cpp.
References EXCEPTION.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractCardiacCellInterface.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, FakeBathCell, and CML_noble_varghese_kohl_noble_1998_basic_with_sac.
Definition at line 70 of file AbstractCardiacCell.hpp.
double AbstractCardiacCell::mDt [protected] |
The timestep to use when simulating this cell. Set from the HeartConfig object.
Definition at line 116 of file AbstractCardiacCell.hpp.
Referenced by Compute(), AbstractBackwardEulerCardiacCell< SIZE >::Compute(), ComputeExceptVoltage(), AbstractBackwardEulerCardiacCell< SIZE >::ComputeExceptVoltage(), serialize(), SetTimestep(), SolveAndUpdateState(), and AbstractBackwardEulerCardiacCell< SIZE >::SolveAndUpdateState().