AbstractCardiacCell Class Reference

#include <AbstractCardiacCell.hpp>

Inheritance diagram for AbstractCardiacCell:

Inheritance graph
[legend]
Collaboration diagram for AbstractCardiacCell:

Collaboration graph
[legend]

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


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 66 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:
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.


Member Function Documentation

template<class Archive>
void AbstractCardiacCell::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

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

void AbstractCardiacCell::SetTimestep ( double  dt  )  [virtual]

Set the timestep to use for simulating this cell.

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

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

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

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

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

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

  • 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:
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.

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

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

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

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:

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

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

Definition at line 159 of file AbstractCardiacCell.cpp.

References EXCEPTION.


Friends And Related Function Documentation

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.


Member Data Documentation

double AbstractCardiacCell::mDt [protected]


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

Generated on Tue May 31 14:31:59 2011 for Chaste by  doxygen 1.5.5