Chaste Release::3.1
AbstractCardiacCell Class Reference

#include <AbstractCardiacCell.hpp>

Inheritance diagram for AbstractCardiacCell:
Collaboration diagram for AbstractCardiacCell:

List of all members.

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< doubleGetStdVecStateVariables ()
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

Detailed Description

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.


Constructor & Destructor Documentation

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().

Parameters:
pOdeSolverthe ODE solver to use when simulating this cell
numberOfStateVariablesthe size of the ODE system modelling this cell
voltageIndexthe index of the transmembrane potential within the vector of state variables
pIntracellularStimulusthe 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.


Member Function Documentation

void AbstractCardiacCell::AdjustOutOfRangeSlowValues ( std::vector< double > &  rSlowValues) [virtual]

In a multiscale simulation a cut-down cell model can be run:

  • fast values are calculated according to the CellML definition
  • slow values are interpolated on synchronisation time-steps. There's a chance that linear interpolation/extrapolation may push some gating variable out of the range [0, 1]. This method alters any values which are out-of-range.
Note:
This must be implemented by fast/slow cardiac cell subclasses.
Parameters:
rSlowValuesA 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.

Parameters:
tStartbeginning of the time interval to simulate
tEndend of the time interval to simulate
tSampsampling 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().

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.

Parameters:
tStartbeginning of the time interval to simulate
tEndend 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.

Parameters:
rNamevariable name
timethe time at which you want it
Returns:
value of the variable at that time

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

Returns:
the number of parameters

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

Returns:
the number of state variables

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).

Note:
This must be implemented by fast/slow cardiac cell subclasses.

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.

Parameters:
rParameterNamethe name of a parameter to get the value of,
Returns:
the parameter's value.

Implements AbstractCardiacCellInterface.

Definition at line 152 of file AbstractCardiacCell.cpp.

Referenced by GetParameter().

double AbstractCardiacCell::GetParameter ( unsigned  parameterIndex) [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.

Parameters:
parameterIndexthe index of a parameter to get the value of,
Returns:
the parameter's value.

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.

Note:
This must be implemented by fast/slow cardiac cell subclasses.
Parameters:
rSlowValueswill 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.

Returns:
the state variables

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().

bool AbstractCardiacCell::IsFastOnly ( ) [virtual]

Get whether this cell is a fast or slow version.

Note:
This must be implemented by fast/slow cardiac cell subclasses.

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.

Returns:
the state variable names in the cell's ODE system.

Implements AbstractCardiacCellInterface.

Definition at line 127 of file AbstractCardiacCell.cpp.

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.

Parameters:
rParameterNamethe parameter name to set the value of,
valuevalue to set it to.

Implements AbstractCardiacCellInterface.

Definition at line 162 of file AbstractCardiacCell.cpp.

Referenced by SetParameter().

void AbstractCardiacCell::SetParameter ( unsigned  parameterIndex,
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.

Parameters:
parameterIndexthe parameter to set the value of,
valuevalue 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.

Note:
This must be implemented by fast/slow cardiac cell subclasses.
Parameters:
rSlowValuesvalues 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

  • set the state
  • initialise the cell
  • SET mNumberOfStateVariables CORRECTLY (as this would not have been known in the constructor.
Note:
This must be implemented by fast/slow cardiac cell subclasses.
Parameters:
statewhether this cell is in fast or slow mode.

Definition at line 200 of file AbstractCardiacCell.cpp.

References EXCEPTION.

void AbstractCardiacCell::SetStateVariable ( unsigned  index,
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.

Parameters:
indexindex of the state variable to be set
newValuenew 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.

Parameters:
rNamename of the state variable to be set
newValuenew 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.

Parameters:
rVariablesthe 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.

Parameters:
dtthe timestep

Implements AbstractCardiacCellInterface.

Definition at line 65 of file AbstractCardiacCell.cpp.

References mDt.

void AbstractCardiacCell::SetVoltage ( double  voltage) [virtual]
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.

Parameters:
tStartbeginning of the time interval to simulate
tEndend 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.


Friends And Related Function Documentation

friend class boost::serialization::access [friend]

Member Data Documentation


The documentation for this class was generated from the following files: