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 #ifndef ABSTRACTCARDIACCELL_HPP_
00030 #define ABSTRACTCARDIACCELL_HPP_
00031
00032 #include <boost/serialization/access.hpp>
00033 #include <boost/serialization/is_abstract.hpp>
00034 #include <boost/serialization/base_object.hpp>
00035 #include <boost/shared_ptr.hpp>
00036 #include <boost/serialization/shared_ptr.hpp>
00037
00038 #include "AbstractOdeSystem.hpp"
00039 #include "AbstractIvpOdeSolver.hpp"
00040 #include "AbstractStimulusFunction.hpp"
00041 #include "HeartConfig.hpp"
00042
00043 #include <vector>
00044
00045 typedef enum _CellModelState
00046 {
00047 STATE_UNSET = 0,
00048 FAST_VARS_ONLY,
00049 ALL_VARS
00050 } CellModelState;
00051
00062 class AbstractCardiacCell : public AbstractOdeSystem
00063 {
00064 private:
00066 friend class boost::serialization::access;
00073 template<class Archive>
00074 void serialize(Archive & archive, const unsigned int version)
00075 {
00076
00077 archive & boost::serialization::base_object<AbstractOdeSystem>(*this);
00078 archive & mDt;
00079 archive & mSetVoltageDerivativeToZero;
00080
00081
00082
00083 }
00084
00085 protected:
00087 unsigned mVoltageIndex;
00089 boost::shared_ptr<AbstractIvpOdeSolver> mpOdeSolver;
00091 double mDt;
00093 boost::shared_ptr<AbstractStimulusFunction> mpIntracellularStimulus;
00094
00100 bool mSetVoltageDerivativeToZero;
00101
00102 public:
00110 AbstractCardiacCell(boost::shared_ptr<AbstractIvpOdeSolver> pOdeSolver,
00111 unsigned numberOfStateVariables,
00112 unsigned voltageIndex,
00113 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00114
00116 virtual ~AbstractCardiacCell();
00117
00123 void Init();
00124
00132 virtual OdeSolution Compute(double tStart, double tEnd);
00133
00141 virtual void ComputeExceptVoltage(double tStart, double tEnd);
00142
00147 virtual double GetIIonic() = 0;
00148
00152 void SetVoltage(double voltage);
00153
00158 double GetVoltage();
00159
00161 unsigned GetVoltageIndex();
00162
00168 void SetStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00169
00175 double GetStimulus(double time);
00176
00180 void SetIntracellularStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00181
00186 double GetIntracellularStimulus(double time);
00187
00195 virtual double GetIntracellularCalciumConcentration();
00196
00203 virtual void VerifyStateVariables()
00204 {
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241 }
00242
00243
00244
00246
00248
00260 virtual void SetState(CellModelState state);
00261
00269 virtual void SetSlowValues(const std::vector<double> &rSlowValues);
00270
00278 virtual void GetSlowValues(std::vector<double>& rSlowValues);
00279
00284 virtual bool IsFastOnly();
00285
00298 virtual void AdjustOutOfRangeSlowValues(std::vector<double>& rSlowValues);
00299
00306 virtual unsigned GetNumSlowValues();
00307
00314 const boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction() const;
00315
00322 const boost::shared_ptr<AbstractIvpOdeSolver> GetSolver() const;
00323
00324 };
00325
00326 BOOST_IS_ABSTRACT(AbstractCardiacCell)
00327
00328 #endif