Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
AbstractCvodeCellWithDataClamp Class Reference

#include <AbstractCvodeCellWithDataClamp.hpp>

+ Inheritance diagram for AbstractCvodeCellWithDataClamp:
+ Collaboration diagram for AbstractCvodeCellWithDataClamp:

Public Member Functions

 AbstractCvodeCellWithDataClamp (boost::shared_ptr< AbstractIvpOdeSolver > pSolver, unsigned numberOfStateVariables, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus)
 
virtual ~AbstractCvodeCellWithDataClamp ()
 
void SetExperimentalData (std::vector< double > experimentalTimes, std::vector< double > experimentalVoltages)
 
void TurnOffDataClamp ()
 
void TurnOnDataClamp (double conductance=100)
 
- Public Member Functions inherited from AbstractCvodeCell
 AbstractCvodeCell (boost::shared_ptr< AbstractIvpOdeSolver > pSolver, unsigned numberOfStateVariables, unsigned voltageIndex, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus)
 
virtual ~AbstractCvodeCell ()
 
double GetVoltage ()
 
void SetVoltage (double voltage)
 
void SetMaxTimestep (double maxDt)
 
void SetTimestep (double maxDt)
 
double GetTimestep ()
 
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)
 
unsigned GetNumberOfStateVariables () const
 
unsigned GetNumberOfParameters () const
 
std::vector< doubleGetStdVecStateVariables ()
 
const std::vector< std::string > & rGetStateVariableNames () const
 
void SetStateVariables (const std::vector< double > &rVariables)
 
void SetStateVariables (const N_Vector &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)
 
- 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< RegularStimulusUseCellMLDefaultStimulus ()
 
bool HasCellMLDefaultStimulus ()
 
virtual AbstractLookupTableCollectionGetLookupTableCollection ()
 
boost::shared_ptr< AbstractStimulusFunctionGetStimulusFunction ()
 
const boost::shared_ptr< AbstractStimulusFunctionGetStimulusFunction () const
 
const boost::shared_ptr< AbstractIvpOdeSolverGetSolver () const
 
void SetSolver (boost::shared_ptr< AbstractIvpOdeSolver > pSolver)
 
void SetFixedVoltage (double voltage)
 
virtual void SetStretch (double stretch)
 
virtual double GetIntracellularCalciumConcentration ()
 
- Public Member Functions inherited from AbstractCvodeSystem
 AbstractCvodeSystem (unsigned numberOfStateVariables)
 
virtual ~AbstractCvodeSystem ()
 
virtual void EvaluateYDerivatives (realtype time, const N_Vector y, N_Vector ydot)=0
 
virtual void EvaluateAnalyticJacobian (realtype time, N_Vector y, N_Vector ydot, CHASTE_CVODE_DENSE_MATRIX jacobian, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3)
 
void SetForceReset (bool autoReset)
 
void SetMinimalReset (bool minimalReset)
 
bool GetMinimalReset ()
 Get whether we want to run with minimal reset or not (no reinitialisation of the solver if variables change)
 
bool GetForceReset ()
 Get whether we will force a solver reset on every call to Solve()
 
void ResetSolver ()
 
OdeSolution Solve (realtype tStart, realtype tEnd, realtype maxDt, realtype tSamp)
 
void Solve (realtype tStart, realtype tEnd, realtype maxDt)
 
void SetMaxSteps (long int numSteps)
 
long int GetMaxSteps ()
 
void SetTolerances (double relTol=1e-5, double absTol=1e-7)
 
double GetRelativeTolerance ()
 
double GetAbsoluteTolerance ()
 
double GetLastStepSize ()
 
bool GetUseAnalyticJacobian () const
 
bool HasAnalyticJacobian () const
 
void ForceUseOfNumericalJacobian (bool useNumericalJacobian=true)
 
- Public Member Functions inherited from AbstractParameterisedSystem< N_Vector >
 AbstractParameterisedSystem (unsigned numberOfStateVariables)
 
N_VectorrGetStateVariables ()
 
N_Vector GetStateVariables ()
 
void SetStateVariables (const N_Vector &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 N_Vector &rInitialConditions)
 
void SetDefaultInitialCondition (unsigned index, double initialCondition)
 
N_Vector 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, N_Vector *pDerivedQuantities=NULL)
 
double GetAnyVariable (const std::string &rName, double time=0.0, N_Vector *pDerivedQuantities=NULL)
 
void SetAnyVariable (unsigned index, double value)
 
void SetAnyVariable (const std::string &rName, double value)
 
virtual N_Vector ComputeDerivedQuantities (double time, const N_Vector &rState)
 
N_Vector ComputeDerivedQuantitiesFromCurrentState (double time)
 
- Public Member Functions inherited from AbstractUntemplatedParameterisedSystem
 AbstractUntemplatedParameterisedSystem (unsigned numberOfStateVariables)
 
virtual ~AbstractUntemplatedParameterisedSystem ()
 
boost::shared_ptr< const AbstractOdeSystemInformationGetSystemInformation () 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 Member Functions

double GetExperimentalVoltageAtTimeT (const double &rTime)
 
- Protected Member Functions inherited from AbstractCvodeSystem
void Init ()
 
- Protected Member Functions inherited from AbstractParameterisedSystem< N_Vector >
std::string DumpState (const std::string &rMessage)
 
std::string DumpState (const std::string &rMessage, N_Vector Y)
 
std::string DumpState (const std::string &rMessage, N_Vector Y, double time)
 
void CheckParametersOnLoad (const std::vector< double > &rParameters, const std::vector< std::string > &rParameterNames)
 

Protected Attributes

bool mDataClampIsOn
 
- Protected Attributes inherited from AbstractCvodeCell
double mMaxDt
 
- Protected Attributes inherited from AbstractCardiacCellInterface
unsigned mVoltageIndex
 
boost::shared_ptr< AbstractIvpOdeSolvermpOdeSolver
 
boost::shared_ptr< AbstractStimulusFunctionmpIntracellularStimulus
 
bool mSetVoltageDerivativeToZero
 
bool mIsUsedInTissue
 
bool mHasDefaultStimulusFromCellML
 
double mFixedVoltage
 
- Protected Attributes inherited from AbstractCvodeSystem
bool mHasAnalyticJacobian
 
bool mUseAnalyticJacobian
 
double mRelTol
 
double mAbsTol
 
void * mpCvodeMem
 
long int mMaxSteps
 
double mLastInternalStepSize
 
- Protected Attributes inherited from AbstractParameterisedSystem< N_Vector >
N_Vector mStateVariables
 
N_Vector mParameters
 
- Protected Attributes inherited from AbstractUntemplatedParameterisedSystem
unsigned mNumberOfStateVariables
 
boost::shared_ptr< AbstractOdeSystemInformationmpSystemInfo
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Attributes

std::vector< doublemExperimentalTimes
 
std::vector< doublemExperimentalVoltages
 
bool mDataAvailable
 

Friends

class TestCvodeCellsWithDataClamp
 
class boost::serialization::access
 

Detailed Description

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

This subclass of AbstractCvodeCell contains methods used by systems that have had an 'artificial' data clamp current introduced into the dV/dt equation. These are generated by chaste_codegen with ConvertCellModel using the option '–cvode-data-clamp'.

Definition at line 51 of file AbstractCvodeCellWithDataClamp.hpp.

Constructor & Destructor Documentation

◆ AbstractCvodeCellWithDataClamp()

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

Constructor

Parameters
pSolverUNUSED for CVODE cells.
numberOfStateVariablesNumber of ODEs in the system.
voltageIndexThe index of the variable which represents membrane voltage.
pIntracellularStimulusThe intracellular stimulus function.

Definition at line 49 of file AbstractCvodeCellWithDataClamp.cpp.

◆ ~AbstractCvodeCellWithDataClamp()

AbstractCvodeCellWithDataClamp::~AbstractCvodeCellWithDataClamp ( )
virtual

Destructor: free any memory we've used.

Definition at line 59 of file AbstractCvodeCellWithDataClamp.cpp.

Member Function Documentation

◆ GetExperimentalVoltageAtTimeT()

double AbstractCvodeCellWithDataClamp::GetExperimentalVoltageAtTimeT ( const double rTime)
protected

Linear interpolation method to work out the voltage at any given time the ODE solver requests.

Parameters
rTimeThe time in the data trace at which to return the voltage (linearly interpolated).
Returns
The voltage at rTime.

Definition at line 73 of file AbstractCvodeCellWithDataClamp.cpp.

References DOUBLE_UNSET, EXCEPTION, mDataClampIsOn, mExperimentalTimes, and mExperimentalVoltages.

◆ serialize()

template<class Archive >
void AbstractCvodeCellWithDataClamp::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Archive the member variables.

Parameters
archive
version

Definition at line 67 of file AbstractCvodeCellWithDataClamp.hpp.

References mDataAvailable, mDataClampIsOn, mExperimentalTimes, and mExperimentalVoltages.

◆ SetExperimentalData()

void AbstractCvodeCellWithDataClamp::SetExperimentalData ( std::vector< double experimentalTimes,
std::vector< double experimentalVoltages 
)

Provide experimental data. Must be called before TurnOnDataClamp().

Parameters
experimentalTimesa vector of times - must be monotonically increasing, but can have variable intervals.
experimentalVoltagesa vector of voltages recorded at these times.

These two vectors must be the same length.

Definition at line 63 of file AbstractCvodeCellWithDataClamp.cpp.

References mDataAvailable, mExperimentalTimes, and mExperimentalVoltages.

◆ TurnOffDataClamp()

void AbstractCvodeCellWithDataClamp::TurnOffDataClamp ( )

Switch off the data clamping current

Definition at line 113 of file AbstractCvodeCellWithDataClamp.cpp.

References mDataClampIsOn, and AbstractCvodeCell::SetParameter().

◆ TurnOnDataClamp()

void AbstractCvodeCellWithDataClamp::TurnOnDataClamp ( double  conductance = 100)

Switch on the data clamping current

Parameters
conductanceThe conductance of the data clamping current - don't yet know best number to set this to.

Definition at line 119 of file AbstractCvodeCellWithDataClamp.cpp.

References EXCEPTION, mDataAvailable, mDataClampIsOn, mExperimentalTimes, and AbstractCvodeCell::SetParameter().

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 58 of file AbstractCvodeCellWithDataClamp.hpp.

◆ TestCvodeCellsWithDataClamp

friend class TestCvodeCellsWithDataClamp
friend

For testing the interpolation method

Definition at line 55 of file AbstractCvodeCellWithDataClamp.hpp.

Member Data Documentation

◆ mDataAvailable

bool AbstractCvodeCellWithDataClamp::mDataAvailable
private

Whether experimental data have been set

Definition at line 86 of file AbstractCvodeCellWithDataClamp.hpp.

Referenced by serialize(), SetExperimentalData(), and TurnOnDataClamp().

◆ mDataClampIsOn

bool AbstractCvodeCellWithDataClamp::mDataClampIsOn
protected

Whether the data clamp is active at the moment

Definition at line 91 of file AbstractCvodeCellWithDataClamp.hpp.

Referenced by GetExperimentalVoltageAtTimeT(), serialize(), TurnOffDataClamp(), and TurnOnDataClamp().

◆ mExperimentalTimes

std::vector<double> AbstractCvodeCellWithDataClamp::mExperimentalTimes
private

The experimental times of voltage measurements in the data

Definition at line 80 of file AbstractCvodeCellWithDataClamp.hpp.

Referenced by GetExperimentalVoltageAtTimeT(), serialize(), SetExperimentalData(), and TurnOnDataClamp().

◆ mExperimentalVoltages

std::vector<double> AbstractCvodeCellWithDataClamp::mExperimentalVoltages
private

The voltages recorded in experiment at the times in mExperimentalTimes, forming data for clamp.

Definition at line 83 of file AbstractCvodeCellWithDataClamp.hpp.

Referenced by GetExperimentalVoltageAtTimeT(), serialize(), and SetExperimentalData().


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