Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
|
#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) |
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 () |
Public Member Functions inherited from AbstractCardiacCellInterface | |
AbstractCardiacCellInterface (boost::shared_ptr< AbstractIvpOdeSolver > pOdeSolver, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus) | |
virtual | ~AbstractCardiacCellInterface () |
virtual double | GetIIonic (const std::vector< double > *pStateVariables=NULL)=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 boost::shared_ptr< RegularStimulus > | UseCellMLDefaultStimulus () |
bool | HasCellMLDefaultStimulus () |
virtual AbstractLookupTableCollection * | GetLookupTableCollection () |
boost::shared_ptr< AbstractStimulusFunction > | GetStimulusFunction () |
const boost::shared_ptr< AbstractStimulusFunction > | GetStimulusFunction () const |
const boost::shared_ptr< AbstractIvpOdeSolver > | GetSolver () const |
void | SetSolver (boost::shared_ptr< AbstractIvpOdeSolver > pSolver) |
virtual void | SetVoltageDerivativeToZero (bool clamp=true) |
void | SetFixedVoltage (double voltage) |
virtual void | SetStretch (double stretch) |
virtual double | GetIntracellularCalciumConcentration () |
Public Member Functions inherited from AbstractOdeSystem | |
AbstractOdeSystem (unsigned numberOfStateVariables) | |
virtual | ~AbstractOdeSystem () |
virtual void | EvaluateYDerivatives (double time, const std::vector< double > &rY, std::vector< double > &rDY)=0 |
virtual bool | CalculateStoppingEvent (double time, const std::vector< double > &rY) |
virtual double | CalculateRootFunction (double time, const std::vector< double > &rY) |
bool | GetUseAnalyticJacobian () |
const std::vector< double > & | rGetConstStateVariables () const |
Public Member Functions inherited from AbstractParameterisedSystem< std::vector< double > > | |
AbstractParameterisedSystem (unsigned numberOfStateVariables) | |
std::vector< double > & | rGetStateVariables () |
std::vector< double > | GetStateVariables () |
void | SetStateVariables (const std::vector< double > &rStateVariables) |
double | GetStateVariable (unsigned index) const |
double | GetStateVariable (const std::string &rName) const |
void | SetStateVariable (unsigned index, double newValue) |
void | SetStateVariable (const std::string &rName, double newValue) |
virtual void | VerifyStateVariables () |
void | SetDefaultInitialConditions (const std::vector< double > &rInitialConditions) |
void | SetDefaultInitialCondition (unsigned index, double initialCondition) |
std::vector< double > | GetInitialConditions () const |
void | ResetToInitialConditions () |
double | GetParameter (unsigned index) const |
double | GetParameter (const std::string &rName) const |
void | SetParameter (const std::string &rName, double value) |
void | SetParameter (unsigned index, double value) |
double | GetAnyVariable (unsigned index, double time=0.0, std::vector< double > *pDerivedQuantities=NULL) |
double | GetAnyVariable (const std::string &rName, double time=0.0, std::vector< double > *pDerivedQuantities=NULL) |
void | SetAnyVariable (unsigned index, double value) |
void | SetAnyVariable (const std::string &rName, double value) |
virtual std::vector< double > | ComputeDerivedQuantities (double time, const std::vector< double > &rState) |
std::vector< double > | ComputeDerivedQuantitiesFromCurrentState (double time) |
Public Member Functions inherited from AbstractUntemplatedParameterisedSystem | |
AbstractUntemplatedParameterisedSystem (unsigned numberOfStateVariables) | |
virtual | ~AbstractUntemplatedParameterisedSystem () |
boost::shared_ptr< const AbstractOdeSystemInformation > | GetSystemInformation () const |
std::string | GetSystemName () const |
unsigned | GetNumberOfAttributes () const |
bool | HasAttribute (const std::string &rName) const |
double | GetAttribute (const std::string &rName) const |
unsigned | GetNumberOfStateVariables () const |
const std::vector< std::string > & | rGetStateVariableNames () const |
const std::vector< std::string > & | rGetStateVariableUnits () const |
unsigned | GetStateVariableIndex (const std::string &rName) const |
bool | HasStateVariable (const std::string &rName) const |
std::string | GetStateVariableUnits (unsigned index) const |
unsigned | GetNumberOfParameters () const |
const std::vector< std::string > & | rGetParameterNames () const |
const std::vector< std::string > & | rGetParameterUnits () const |
unsigned | GetParameterIndex (const std::string &rName) const |
bool | HasParameter (const std::string &rName) const |
std::string | GetParameterUnits (unsigned index) const |
unsigned | GetNumberOfDerivedQuantities () const |
const std::vector< std::string > & | rGetDerivedQuantityNames () const |
const std::vector< std::string > & | rGetDerivedQuantityUnits () const |
unsigned | GetDerivedQuantityIndex (const std::string &rName) const |
bool | HasDerivedQuantity (const std::string &rName) const |
std::string | GetDerivedQuantityUnits (unsigned index) const |
unsigned | GetAnyVariableIndex (const std::string &rName) const |
bool | HasAnyVariable (const std::string &rName) const |
std::string | GetAnyVariableUnits (unsigned index) const |
std::string | GetAnyVariableUnits (const std::string &rName) const |
Protected Attributes | |
double | mDt |
Protected Attributes inherited from AbstractCardiacCellInterface | |
unsigned | mVoltageIndex |
boost::shared_ptr< AbstractIvpOdeSolver > | mpOdeSolver |
boost::shared_ptr< AbstractStimulusFunction > | mpIntracellularStimulus |
bool | mSetVoltageDerivativeToZero |
bool | mIsUsedInTissue |
bool | mHasDefaultStimulusFromCellML |
double | mFixedVoltage |
Protected Attributes inherited from AbstractOdeSystem | |
bool | mUseAnalyticJacobian |
Protected Attributes inherited from AbstractParameterisedSystem< std::vector< double > > | |
std::vector< double > | mStateVariables |
std::vector< double > | mParameters |
Protected Attributes inherited from AbstractUntemplatedParameterisedSystem | |
unsigned | mNumberOfStateVariables |
boost::shared_ptr< AbstractOdeSystemInformation > | mpSystemInfo |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
void | CheckForArchiveFix () |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Protected Member Functions inherited from AbstractParameterisedSystem< std::vector< double > > | |
std::string | DumpState (const std::string &rMessage) |
std::string | DumpState (const std::string &rMessage, std::vector< double > Y) |
std::string | DumpState (const std::string &rMessage, std::vector< double > Y, double time) |
void | CheckParametersOnLoad (const std::vector< double > &rParameters, const std::vector< std::string > &rParameterNames) |
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 chaste_codegen, 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.
|
virtual |
Virtual destructor
Definition at line 55 of file AbstractCardiacCell.cpp.
|
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 229 of file AbstractCardiacCell.cpp.
References EXCEPTION.
|
private |
The Luo-Rudy 1991 model saved in previous Chaste versions had a different ordering of state variables.
It also didn't save mParameters.
Gary: Any changes to other cell models won't work anyway, and as the comment above says, these cells won't work in tissue. We also don't seem to have been checking for optimised cell models. So I think we should retire this conversion with a NEVER_REACHED.
If we're loading that model, we could permute the state vector. This can't (easily) be done in the LR91 code itself, since that is auto-generated!
Definition at line 175 of file AbstractCardiacCell.cpp.
References NEVER_REACHED.
Referenced by serialize().
|
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 >, AbstractBackwardEulerCardiacCell< 0u >, AbstractGeneralizedRushLarsenCardiacCell, and AbstractRushLarsenCardiacCell.
Definition at line 75 of file AbstractCardiacCell.cpp.
References mDt, AbstractCardiacCellInterface::mpOdeSolver, AbstractParameterisedSystem< std::vector< double > >::rGetStateVariables(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
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 >, AbstractBackwardEulerCardiacCell< 0u >, AbstractGeneralizedRushLarsenCardiacCell, AbstractRushLarsenCardiacCell, and FakeBathCell.
Definition at line 90 of file AbstractCardiacCell.cpp.
References GetVoltage(), mDt, AbstractCardiacCellInterface::mpOdeSolver, SetVoltage(), AbstractCardiacCellInterface::SetVoltageDerivativeToZero(), and AbstractParameterisedSystem< std::vector< double > >::VerifyStateVariables().
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 153 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::GetAnyVariable().
Referenced by LuoRudySpiralWaveCellFactory::CreateCardiacCellForTissueNode().
|
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 123 of file AbstractCardiacCell.cpp.
References AbstractUntemplatedParameterisedSystem::GetNumberOfParameters().
|
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 118 of file AbstractCardiacCell.cpp.
References AbstractUntemplatedParameterisedSystem::GetNumberOfStateVariables().
|
virtual |
Definition at line 224 of file AbstractCardiacCell.cpp.
References EXCEPTION.
|
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 158 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::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 163 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::GetParameter().
|
virtual |
Returns the current values of the slow variables (via rSlowValues). Should only be valid in slow mode.
rSlowValues | will be filled in with the values of the slow variables (returned). |
Definition at line 214 of file AbstractCardiacCell.cpp.
References EXCEPTION.
|
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 128 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::GetStateVariables().
|
virtual |
Implements AbstractCardiacCellInterface.
Definition at line 113 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::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().
|
virtual |
Definition at line 219 of file AbstractCardiacCell.cpp.
References EXCEPTION.
|
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 133 of file AbstractCardiacCell.cpp.
References AbstractUntemplatedParameterisedSystem::rGetStateVariableNames().
|
inlineprivate |
Archive the member variables.
archive | |
version |
Definition at line 86 of file AbstractCardiacCell.hpp.
References CheckForArchiveFix(), mDt, AbstractCardiacCellInterface::mHasDefaultStimulusFromCellML, AbstractCardiacCellInterface::mIsUsedInTissue, AbstractParameterisedSystem< std::vector< double > >::mParameters, and AbstractCardiacCellInterface::mSetVoltageDerivativeToZero.
|
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 168 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::SetParameter().
Referenced by LuoRudySpiralWaveCellFactory::CreateCardiacCellForTissueNode().
|
virtual |
Set the slow variables. Should only be valid in fast mode.
rSlowValues | values for the slow variables |
Definition at line 209 of file AbstractCardiacCell.cpp.
References EXCEPTION.
|
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 204 of file AbstractCardiacCell.cpp.
References EXCEPTION.
|
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 148 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::SetStateVariable().
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 143 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::SetStateVariable().
|
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 138 of file AbstractCardiacCell.cpp.
References AbstractParameterisedSystem< std::vector< double > >::SetStateVariables().
|
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.
|
virtual |
Set the transmembrane potential
voltage | new value |
Implements AbstractCardiacCellInterface.
Definition at line 107 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 >, AbstractBackwardEulerCardiacCell< 0u >, AbstractGeneralizedRushLarsenCardiacCell, and AbstractRushLarsenCardiacCell.
Definition at line 70 of file AbstractCardiacCell.cpp.
References mDt, and AbstractCardiacCellInterface::mpOdeSolver.
|
friend |
Needed for serialization.
Definition at line 78 of file AbstractCardiacCell.hpp.
|
protected |
The timestep to use when simulating this cell. Set from the HeartConfig object.
Definition at line 137 of file AbstractCardiacCell.hpp.
Referenced by AbstractBackwardEulerCardiacCell< 0u >::Compute(), Compute(), AbstractGeneralizedRushLarsenCardiacCell::Compute(), AbstractRushLarsenCardiacCell::Compute(), AbstractBackwardEulerCardiacCell< 0u >::ComputeExceptVoltage(), ComputeExceptVoltage(), AbstractGeneralizedRushLarsenCardiacCell::ComputeExceptVoltage(), AbstractRushLarsenCardiacCell::ComputeExceptVoltage(), serialize(), SetTimestep(), AbstractBackwardEulerCardiacCell< 0u >::SolveAndUpdateState(), SolveAndUpdateState(), AbstractGeneralizedRushLarsenCardiacCell::SolveAndUpdateState(), AbstractRushLarsenCardiacCell::SolveAndUpdateState(), and AbstractRushLarsenCardiacCell::UpdateTransmembranePotential().