AbstractCvodeCell Class Reference

#include <AbstractCvodeCell.hpp>

Inherits AbstractCardiacCellInterface, and AbstractCvodeSystem.

Collaboration diagram for AbstractCvodeCell:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AbstractCvodeCell (boost::shared_ptr< AbstractIvpOdeSolver > pSolver, unsigned numberOfStateVariables, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus)
virtual ~AbstractCvodeCell ()
double GetVoltage ()
void SetVoltage (double voltage)
void SetTimestep (double maxDt)
virtual void SolveAndUpdateState (double tStart, double tEnd)
OdeSolution Compute (double tStart, double tEnd, double tSamp=0.0)
void ComputeExceptVoltage (double tStart, double tEnd)
void SetVoltageDerivativeToZero (bool clamp=true)

Private Attributes

double mMaxDt

Detailed Description

A cardiac cell that is designed to be simulated using CVODE. It uses CVODE's vector type natively.

Functionality is similar to that provided by AbstractCardiacCell and AbstractOdeSystem, but not identical. It also includes a direct interface to the CVODE solver, via the Solve methods, since the CvodeAdaptor class doesn't work for us.

Assumes that it will be solving stiff systems, so uses BDF/Newton.

Note that a call to Solve will initialise the CVODE solver, and free its working memory when done. There is thus a non-trivial overhead involved.

Todo:
#890 Add an option to just initialise once, and assume subsequent Solve calls are continuing from where we left off.

Definition at line 59 of file AbstractCvodeCell.hpp.


Constructor & Destructor Documentation

AbstractCvodeCell::AbstractCvodeCell ( boost::shared_ptr< AbstractIvpOdeSolver pSolver,
unsigned  numberOfStateVariables,
unsigned  voltageIndex,
boost::shared_ptr< AbstractStimulusFunction pIntracellularStimulus 
)

Create a new cardiac cell.

Note:
subclasses must call Init() in their constructor after setting mpSystemInfo.
Parameters:
pSolver not used for these cells (they're always solved with CVODE); may be empty
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 41 of file AbstractCvodeCell.cpp.

AbstractCvodeCell::~AbstractCvodeCell (  )  [virtual]

Free the state variables, if they have been set.

Definition at line 52 of file AbstractCvodeCell.cpp.


Member Function Documentation

OdeSolution AbstractCvodeCell::Compute ( double  tStart,
double  tEnd,
double  tSamp = 0.0 
) [virtual]

Simulates this cell's behaviour between the time interval [tStart, tEnd], and return state variable values.

The maximum time step to use will be taken as mMaxDt. If this is unset it is the same as the sampling interval, which defaults to HeartConfig::Instance()->GetPrintingTimeStep().

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

Implements AbstractCardiacCellInterface.

Definition at line 84 of file AbstractCvodeCell.cpp.

References DOUBLE_UNSET, HeartConfig::GetPrintingTimeStep(), HeartConfig::Instance(), mMaxDt, SetTimestep(), and AbstractCvodeSystem::Solve().

void AbstractCvodeCell::ComputeExceptVoltage ( double  tStart,
double  tEnd 
) [virtual]

Simulates this cell's behaviour between the time interval [tStart, tEnd], 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.

Definition at line 98 of file AbstractCvodeCell.cpp.

References EXCEPTION.

double AbstractCvodeCell::GetVoltage (  )  [virtual]

Get the current value of the transmembrane potential, as given in our state variable vector.

Implements AbstractCardiacCellInterface.

Definition at line 56 of file AbstractCvodeCell.cpp.

References AbstractParameterisedSystem< N_Vector >::GetAnyVariable(), AbstractParameterisedSystem< N_Vector >::mStateVariables, and AbstractCardiacCellInterface::mVoltageIndex.

void AbstractCvodeCell::SetTimestep ( double  maxDt  )  [virtual]

Set the maximum timestep to use for simulating this cell.

Parameters:
maxDt the maximum timestep

Implements AbstractCardiacCellInterface.

Definition at line 69 of file AbstractCvodeCell.cpp.

References mMaxDt.

Referenced by Compute(), and SolveAndUpdateState().

void AbstractCvodeCell::SetVoltage ( double  voltage  )  [virtual]
void AbstractCvodeCell::SetVoltageDerivativeToZero ( bool  clamp = true  )  [virtual]

Set whether to clamp the voltage by setting its derivative to zero. We need to ensure CVODE is re-initialised if this setting changes.

Parameters:
clamp whether to clamp

Reimplemented from AbstractCardiacCellInterface.

Definition at line 104 of file AbstractCvodeCell.cpp.

References AbstractCardiacCellInterface::mSetVoltageDerivativeToZero, and AbstractCvodeSystem::ResetSolver().

void AbstractCvodeCell::SolveAndUpdateState ( double  tStart,
double  tEnd 
) [virtual]

Simulate this cell's behaviour between the time interval [tStart, tEnd], updating the internal state variable values.

The maximum time step to use is given by mMaxDt, which defaults to HeartConfig::Instance()->GetPrintingTimeStep() if unset.

Parameters:
tStart beginning of the time interval to simulate
tEnd end of the time interval to simulate

Implements AbstractCardiacCellInterface.

Definition at line 75 of file AbstractCvodeCell.cpp.

References DOUBLE_UNSET, HeartConfig::Instance(), mMaxDt, SetTimestep(), and AbstractCvodeSystem::Solve().


Member Data Documentation

The maximum timestep to use.

Definition at line 63 of file AbstractCvodeCell.hpp.

Referenced by Compute(), SetTimestep(), and SolveAndUpdateState().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:00:58 2011 for Chaste by  doxygen 1.6.3