Chaste Release::3.1
|
#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 () |
unsigned | GetNumberOfStateVariables () const |
unsigned | GetNumberOfParameters () const |
std::vector< double > | GetStdVecStateVariables () |
const std::vector< std::string > & | rGetStateVariableNames () const |
void | SetStateVariables (const std::vector< double > &rVariables) |
void | SetStateVariable (unsigned index, double newValue) |
void | SetStateVariable (const std::string &rName, double newValue) |
double | GetAnyVariable (const std::string &rName, double time=0.0) |
double | GetParameter (const std::string &rParameterName) |
double | GetParameter (unsigned parameterIndex) |
void | SetParameter (const std::string &rParameterName, double value) |
void | SetParameter (unsigned parameterIndex, double value) |
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 |
This is the base class for ode-based cardiac cell models.
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 74 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 43 of file AbstractCardiacCell.cpp.
References AbstractUntemplatedParameterisedSystem::mNumberOfStateVariables.
AbstractCardiacCell::~AbstractCardiacCell | ( | ) | [virtual] |
Virtual destructor
Definition at line 55 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 225 of file AbstractCardiacCell.cpp.
References EXCEPTION.
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 174 of file AbstractCardiacCell.cpp.
References GetNumberOfStateVariables(), AbstractParameterisedSystem< std::vector< double > >::mParameters, AbstractParameterisedSystem< std::vector< double > >::mStateVariables, and AbstractUntemplatedParameterisedSystem::rGetParameterNames().
Referenced by serialize().
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 >, and AbstractRushLarsenCardiacCell.
Definition at line 75 of file AbstractCardiacCell.cpp.
References mDt, AbstractCardiacCellInterface::mpOdeSolver, and AbstractParameterisedSystem< std::vector< double > >::rGetStateVariables().
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 >, AbstractRushLarsenCardiacCell, and FakeBathCell.
Definition at line 84 of file AbstractCardiacCell.cpp.
References GetVoltage(), mDt, AbstractCardiacCellInterface::mpOdeSolver, SetVoltage(), AbstractCardiacCellInterface::SetVoltageDerivativeToZero(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
double AbstractCardiacCell::GetAnyVariable | ( | const std::string & | rName, |
double | time = 0.0 |
||
) | [virtual] |
This just calls the method AbstractOdeSystem::GetAnyVariable
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
rName | variable name |
time | the time at which you want it |
Implements AbstractCardiacCellInterface.
Definition at line 147 of file AbstractCardiacCell.cpp.
Referenced by GetVoltage().
unsigned AbstractCardiacCell::GetNumberOfParameters | ( | ) | const [virtual] |
This just returns the number of parameters in the cell model.
It is here because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface
Implements AbstractCardiacCellInterface.
Definition at line 117 of file AbstractCardiacCell.cpp.
unsigned AbstractCardiacCell::GetNumberOfStateVariables | ( | ) | const [virtual] |
This just returns the number of state variables in the cell model.
It is here because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface
Implements AbstractCardiacCellInterface.
Definition at line 112 of file AbstractCardiacCell.cpp.
Referenced by CheckForArchiveFix().
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 220 of file AbstractCardiacCell.cpp.
References EXCEPTION.
double AbstractCardiacCell::GetParameter | ( | const std::string & | rParameterName | ) | [virtual] |
This just calls AbstractOdeSystem::GetParameter
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
rParameterName | the name of a parameter to get the value of, |
Implements AbstractCardiacCellInterface.
Definition at line 152 of file AbstractCardiacCell.cpp.
Referenced by GetParameter().
This just calls AbstractOdeSystem::GetParameter
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
parameterIndex | the index of a parameter to get the value of, |
Implements AbstractCardiacCellInterface.
Definition at line 157 of file AbstractCardiacCell.cpp.
References GetParameter().
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 210 of file AbstractCardiacCell.cpp.
References EXCEPTION.
std::vector< double > AbstractCardiacCell::GetStdVecStateVariables | ( | ) | [virtual] |
This just returns the state variables in the cell model.
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
Implements AbstractCardiacCellInterface.
Definition at line 122 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::GetStateVariables().
double AbstractCardiacCell::GetVoltage | ( | ) | [virtual] |
Get the current value of the transmembrane potential, as given in our state variable vector.
Implements AbstractCardiacCellInterface.
Definition at line 107 of file AbstractCardiacCell.cpp.
References GetAnyVariable(), and AbstractCardiacCellInterface::mVoltageIndex.
Referenced by ComputeExceptVoltage().
void AbstractCardiacCell::Init | ( | ) |
Initialise the cell:
Definition at line 59 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::mParameters, AbstractParameterisedSystem< std::vector< double > >::ResetToInitialConditions(), and AbstractUntemplatedParameterisedSystem::rGetParameterNames().
Referenced by CML_noble_varghese_kohl_noble_1998_basic_with_sac::CML_noble_varghese_kohl_noble_1998_basic_with_sac(), CorriasBuistICCModified::CorriasBuistICCModified(), CorriasBuistSMCModified::CorriasBuistSMCModified(), FakeBathCell::FakeBathCell(), and FitzHughNagumo1961OdeSystem::FitzHughNagumo1961OdeSystem().
bool AbstractCardiacCell::IsFastOnly | ( | ) | [virtual] |
Get whether this cell is a fast or slow version.
Definition at line 215 of file AbstractCardiacCell.cpp.
References EXCEPTION.
const std::vector< std::string > & AbstractCardiacCell::rGetStateVariableNames | ( | ) | const [virtual] |
Just calls AbstractOdeSystem::rGetStateVariableNames().
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
Implements AbstractCardiacCellInterface.
Definition at line 127 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 >, AbstractRushLarsenCardiacCell, FakeBathCell, CML_noble_varghese_kohl_noble_1998_basic_with_sac, CorriasBuistICCModified, and CorriasBuistSMCModified.
Definition at line 86 of file AbstractCardiacCell.hpp.
References CheckForArchiveFix(), mDt, AbstractCardiacCellInterface::mHasDefaultStimulusFromCellML, AbstractCardiacCellInterface::mIsUsedInTissue, AbstractParameterisedSystem< std::vector< double > >::mParameters, AbstractCardiacCellInterface::mSetVoltageDerivativeToZero, and AbstractUntemplatedParameterisedSystem::rGetParameterNames().
void AbstractCardiacCell::SetParameter | ( | const std::string & | rParameterName, |
double | value | ||
) | [virtual] |
This just calls AbstractOdeSystem::SetParameter
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
rParameterName | the parameter name to set the value of, |
value | value to set it to. |
Implements AbstractCardiacCellInterface.
Definition at line 162 of file AbstractCardiacCell.cpp.
Referenced by SetParameter().
This just calls AbstractOdeSystem::SetParameter
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
parameterIndex | the parameter to set the value of, |
value | value to set it to. |
Implements AbstractCardiacCellInterface.
Definition at line 167 of file AbstractCardiacCell.cpp.
References SetParameter().
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 205 of file AbstractCardiacCell.cpp.
References EXCEPTION.
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 200 of file AbstractCardiacCell.cpp.
References EXCEPTION.
This just calls the method AbstractOdeSystem::SetStateVariable
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
index | index of the state variable to be set |
newValue | new value of the state variable |
Implements AbstractCardiacCellInterface.
Definition at line 137 of file AbstractCardiacCell.cpp.
Referenced by SetStateVariable().
void AbstractCardiacCell::SetStateVariable | ( | const std::string & | rName, |
double | newValue | ||
) | [virtual] |
This just calls the method AbstractOdeSystem::SetStateVariable
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
rName | name of the state variable to be set |
newValue | new value of the state variable |
Implements AbstractCardiacCellInterface.
Definition at line 142 of file AbstractCardiacCell.cpp.
References SetStateVariable().
void AbstractCardiacCell::SetStateVariables | ( | const std::vector< double > & | rVariables | ) | [virtual] |
This just sets the state variables in the cell model.
It is here (despite being inherited) because we seem to need to specify explicitly which method in the parent classes we intend to implement to take care of the pure definition in AbstractCardiacCellInterface.
rVariables | the state variables (to take a copy of). |
Implements AbstractCardiacCellInterface.
Definition at line 132 of file AbstractCardiacCell.cpp.
void AbstractCardiacCell::SetTimestep | ( | double | dt | ) | [virtual] |
Set the timestep to use for simulating this cell.
dt | the timestep |
Implements AbstractCardiacCellInterface.
Definition at line 65 of file AbstractCardiacCell.cpp.
References mDt.
void AbstractCardiacCell::SetVoltage | ( | double | voltage | ) | [virtual] |
Set the transmembrane potential
voltage | new value |
Implements AbstractCardiacCellInterface.
Definition at line 101 of file AbstractCardiacCell.cpp.
References AbstractCardiacCellInterface::mVoltageIndex, AbstractParameterisedSystem< std::vector< double > >::SetAnyVariable(), and AbstractCardiacCellInterface::SetFixedVoltage().
Referenced by ComputeExceptVoltage().
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 >, and AbstractRushLarsenCardiacCell.
Definition at line 70 of file AbstractCardiacCell.cpp.
References mDt, and AbstractCardiacCellInterface::mpOdeSolver.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractCardiacCellInterface.
Reimplemented in AbstractBackwardEulerCardiacCell< SIZE >, AbstractRushLarsenCardiacCell, FakeBathCell, CML_noble_varghese_kohl_noble_1998_basic_with_sac, CorriasBuistICCModified, and CorriasBuistSMCModified.
Definition at line 78 of file AbstractCardiacCell.hpp.
double AbstractCardiacCell::mDt [protected] |
The timestep to use when simulating this cell. Set from the HeartConfig object.
Definition at line 130 of file AbstractCardiacCell.hpp.
Referenced by AbstractRushLarsenCardiacCell::Compute(), Compute(), AbstractRushLarsenCardiacCell::ComputeExceptVoltage(), ComputeExceptVoltage(), serialize(), SetTimestep(), AbstractRushLarsenCardiacCell::SolveAndUpdateState(), SolveAndUpdateState(), and AbstractRushLarsenCardiacCell::UpdateTransmembranePotential().