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
00062 class AbstractCardiacCellInterface
00063 {
00064 public:
00077 AbstractCardiacCellInterface(boost::shared_ptr<AbstractIvpOdeSolver> pOdeSolver,
00078 unsigned voltageIndex,
00079 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00080
00082 virtual ~AbstractCardiacCellInterface();
00083
00089 virtual void SetTimestep(double dt)=0;
00090
00098 virtual unsigned GetNumberOfStateVariables() const=0;
00099
00105 virtual unsigned GetNumberOfParameters() const=0;
00106
00116 virtual std::vector<double> GetStdVecStateVariables()=0;
00117
00125 virtual const std::vector<std::string>& rGetStateVariableNames() const=0;
00126
00127
00135 virtual void SetStateVariables(const std::vector<double>& rVariables)=0;
00136
00145 virtual void SetStateVariable(unsigned index, double newValue)=0;
00146
00156 virtual void SetStateVariable(const std::string& rName, double newValue)=0;
00157
00167 virtual double GetAnyVariable(const std::string& rName, double time)=0;
00168
00177 virtual double GetParameter(const std::string& rParameterName)=0;
00178
00187 virtual double GetParameter(unsigned parameterIndex)=0;
00188
00197 virtual void SetParameter(const std::string& rParameterName, double value)=0;
00198
00207 virtual void SolveAndUpdateState(double tStart, double tEnd)=0;
00208
00219 virtual OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0)=0;
00220
00229 virtual void ComputeExceptVoltage(double tStart, double tEnd)=0;
00230
00260 virtual double GetIIonic(const std::vector<double>* pStateVariables=NULL)=0;
00261
00266 virtual void SetVoltage(double voltage)=0;
00267
00271 virtual double GetVoltage()=0;
00272
00279 unsigned GetVoltageIndex();
00280
00286 void SetStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00287
00293 double GetStimulus(double time);
00294
00301 void SetIntracellularStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00302
00310 double GetIntracellularStimulus(double time);
00311
00318 double GetIntracellularAreaStimulus(double time);
00319
00328 void SetUsedInTissueSimulation(bool tissue=true);
00329
00337 virtual boost::shared_ptr<RegularStimulus> UseCellMLDefaultStimulus();
00338
00342 bool HasCellMLDefaultStimulus();
00343
00350 virtual AbstractLookupTableCollection* GetLookupTableCollection()
00351 {
00352 return NULL;
00353 }
00354
00358 boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction();
00359
00366 const boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction() const;
00367
00374 const boost::shared_ptr<AbstractIvpOdeSolver> GetSolver() const;
00375
00380 virtual void SetVoltageDerivativeToZero(bool clamp=true);
00381
00389 void SetFixedVoltage(double voltage);
00390
00398 virtual void SetStretch(double stretch)
00399 {
00400 }
00401
00410 virtual double GetIntracellularCalciumConcentration();
00411
00412 protected:
00419 unsigned mVoltageIndex;
00420
00422 boost::shared_ptr<AbstractIvpOdeSolver> mpOdeSolver;
00423
00425 boost::shared_ptr<AbstractStimulusFunction> mpIntracellularStimulus;
00426
00432 bool mSetVoltageDerivativeToZero;
00433
00435 bool mIsUsedInTissue;
00436
00438 bool mHasDefaultStimulusFromCellML;
00439
00441 double mFixedVoltage;
00442
00443 private:
00445 friend class boost::serialization::access;
00452 template<class Archive>
00453 void serialize(Archive & archive, const unsigned int version)
00454 {
00455
00456
00457 if (version > 0)
00458 {
00459 archive & mSetVoltageDerivativeToZero;
00460 archive & mIsUsedInTissue;
00461 archive & mHasDefaultStimulusFromCellML;
00462
00463 }
00464
00465
00466
00467 }
00468 };
00469
00470 CLASS_IS_ABSTRACT(AbstractCardiacCellInterface)
00471 BOOST_CLASS_VERSION(AbstractCardiacCellInterface, 1)
00472
00473 #endif