Chaste
Release::3.4
|
#include <AbstractCvodeCellWithDataClamp.hpp>
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< double > | GetStdVecStateVariables () |
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 < 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) |
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 (long int N, 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) |
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_Vector & | rGetStateVariables () |
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 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 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_VectorY) |
std::string | DumpState (const std::string &rMessage, N_VectorY, 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 < AbstractIvpOdeSolver > | mpOdeSolver |
boost::shared_ptr < AbstractStimulusFunction > | mpIntracellularStimulus |
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 < AbstractOdeSystemInformation > | mpSystemInfo |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
Private Attributes | |
std::vector< double > | mExperimentalTimes |
std::vector< double > | mExperimentalVoltages |
bool | mDataAvailable |
Friends | |
class | TestCvodeCellsWithDataClamp |
class | boost::serialization::access |
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 PyCML with ConvertCellModel using the option '–cvode-data-clamp'.
Definition at line 51 of file AbstractCvodeCellWithDataClamp.hpp.
AbstractCvodeCellWithDataClamp::AbstractCvodeCellWithDataClamp | ( | boost::shared_ptr< AbstractIvpOdeSolver > | pSolver, |
unsigned | numberOfStateVariables, | ||
unsigned | voltageIndex, | ||
boost::shared_ptr< AbstractStimulusFunction > | pIntracellularStimulus | ||
) |
Constructor
pSolver | UNUSED for CVODE cells. |
numberOfStateVariables | Number of ODEs in the system. |
voltageIndex | The index of the variable which represents membrane voltage. |
pIntracellularStimulus | The intracellular stimulus function. |
Definition at line 49 of file AbstractCvodeCellWithDataClamp.cpp.
|
virtual |
Destructor: free any memory we've used.
Definition at line 59 of file AbstractCvodeCellWithDataClamp.cpp.
|
protected |
Linear interpolation method to work out the voltage at any given time the ODE solver requests.
rTime | The time in the data trace at which to return the voltage (linearly interpolated). |
Definition at line 73 of file AbstractCvodeCellWithDataClamp.cpp.
References DOUBLE_UNSET, EXCEPTION, mDataClampIsOn, mExperimentalTimes, and mExperimentalVoltages.
|
inlineprivate |
Archive the member variables.
archive | |
version |
Definition at line 67 of file AbstractCvodeCellWithDataClamp.hpp.
References mDataAvailable, mDataClampIsOn, mExperimentalTimes, and mExperimentalVoltages.
void AbstractCvodeCellWithDataClamp::SetExperimentalData | ( | std::vector< double > | experimentalTimes, |
std::vector< double > | experimentalVoltages | ||
) |
Provide experimental data. Must be called before TurnOnDataClamp().
experimentalTimes | a vector of times - must be monotonically increasing, but can have variable intervals. |
experimentalVoltages | a 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.
void AbstractCvodeCellWithDataClamp::TurnOffDataClamp | ( | ) |
Switch off the data clamping current
Definition at line 127 of file AbstractCvodeCellWithDataClamp.cpp.
References mDataClampIsOn, and AbstractCvodeCell::SetParameter().
void AbstractCvodeCellWithDataClamp::TurnOnDataClamp | ( | double | conductance = 100 | ) |
Switch on the data clamping current
conductance | The conductance of the data clamping current - don't yet know best number to set this to. |
Definition at line 133 of file AbstractCvodeCellWithDataClamp.cpp.
References EXCEPTION, mDataAvailable, mDataClampIsOn, mExperimentalTimes, and AbstractCvodeCell::SetParameter().
|
friend |
Needed for serialization.
Definition at line 58 of file AbstractCvodeCellWithDataClamp.hpp.
|
friend |
For testing the interpolation method
Definition at line 55 of file AbstractCvodeCellWithDataClamp.hpp.
|
private |
Whether experimental data have been set
Definition at line 86 of file AbstractCvodeCellWithDataClamp.hpp.
Referenced by serialize(), SetExperimentalData(), and TurnOnDataClamp().
|
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().
|
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().
|
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().