AbstractCardiacCellInterface.hpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef ABSTRACTCARDIACCELLINTERFACE_HPP_
00037 #define ABSTRACTCARDIACCELLINTERFACE_HPP_
00038
00039 #include <boost/shared_ptr.hpp>
00040
00041 #include "ChasteSerialization.hpp"
00042 #include "ChasteSerializationVersion.hpp"
00043 #include "ClassIsAbstract.hpp"
00044
00045 #include "AbstractIvpOdeSolver.hpp"
00046 #include "RegularStimulus.hpp"
00047 #include "OdeSolution.hpp"
00048 #include "AbstractLookupTableCollection.hpp"
00049
00058 class AbstractCardiacCellInterface
00059 {
00060 public:
00073 AbstractCardiacCellInterface(boost::shared_ptr<AbstractIvpOdeSolver> pOdeSolver,
00074 unsigned voltageIndex,
00075 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00076
00078 virtual ~AbstractCardiacCellInterface();
00079
00085 virtual void SetTimestep(double dt)=0;
00086
00094 virtual unsigned GetNumberOfStateVariables() const=0;
00095
00101 virtual unsigned GetNumberOfParameters() const=0;
00102
00112 virtual std::vector<double> GetStdVecStateVariables()=0;
00113
00121 virtual const std::vector<std::string>& rGetStateVariableNames() const=0;
00122
00123
00131 virtual void SetStateVariables(const std::vector<double>& rVariables)=0;
00132
00141 virtual void SetStateVariable(unsigned index, double newValue)=0;
00142
00152 virtual void SetStateVariable(const std::string& rName, double newValue)=0;
00153
00163 virtual double GetAnyVariable(const std::string& rName, double time)=0;
00164
00173 virtual double GetParameter(const std::string& rParameterName)=0;
00174
00183 virtual double GetParameter(unsigned parameterIndex)=0;
00184
00193 virtual void SetParameter(const std::string& rParameterName, double value)=0;
00194
00203 virtual void SolveAndUpdateState(double tStart, double tEnd)=0;
00204
00215 virtual OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0)=0;
00216
00225 virtual void ComputeExceptVoltage(double tStart, double tEnd)=0;
00226
00256 virtual double GetIIonic(const std::vector<double>* pStateVariables=NULL)=0;
00257
00262 virtual void SetVoltage(double voltage)=0;
00263
00267 virtual double GetVoltage()=0;
00268
00275 unsigned GetVoltageIndex();
00276
00282 void SetStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00283
00289 double GetStimulus(double time);
00290
00297 void SetIntracellularStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00298
00306 double GetIntracellularStimulus(double time);
00307
00314 double GetIntracellularAreaStimulus(double time);
00315
00324 void SetUsedInTissueSimulation(bool tissue=true);
00325
00333 virtual boost::shared_ptr<RegularStimulus> UseCellMLDefaultStimulus();
00334
00338 bool HasCellMLDefaultStimulus();
00339
00346 virtual AbstractLookupTableCollection* GetLookupTableCollection()
00347 {
00348 return NULL;
00349 }
00350
00354 boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction();
00355
00362 const boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction() const;
00363
00370 const boost::shared_ptr<AbstractIvpOdeSolver> GetSolver() const;
00371
00379 void SetSolver(boost::shared_ptr<AbstractIvpOdeSolver> pSolver);
00380
00385 virtual void SetVoltageDerivativeToZero(bool clamp=true);
00386
00394 void SetFixedVoltage(double voltage);
00395
00403 virtual void SetStretch(double stretch)
00404 {
00405 }
00406
00415 virtual double GetIntracellularCalciumConcentration();
00416
00417 protected:
00424 unsigned mVoltageIndex;
00425
00427 boost::shared_ptr<AbstractIvpOdeSolver> mpOdeSolver;
00428
00430 boost::shared_ptr<AbstractStimulusFunction> mpIntracellularStimulus;
00431
00437 bool mSetVoltageDerivativeToZero;
00438
00440 bool mIsUsedInTissue;
00441
00443 bool mHasDefaultStimulusFromCellML;
00444
00446 double mFixedVoltage;
00447
00448 private:
00450 friend class boost::serialization::access;
00457 template<class Archive>
00458 void serialize(Archive & archive, const unsigned int version)
00459 {
00460
00461
00462 if (version > 0)
00463 {
00464 archive & mSetVoltageDerivativeToZero;
00465 archive & mIsUsedInTissue;
00466 archive & mHasDefaultStimulusFromCellML;
00467
00468 }
00469
00470
00471
00472 }
00473 };
00474
00475 CLASS_IS_ABSTRACT(AbstractCardiacCellInterface)
00476 BOOST_CLASS_VERSION(AbstractCardiacCellInterface, 1)
00477
00478 #endif