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 "ChasteSerialization.hpp"
00033 #include "ClassIsAbstract.hpp"
00034 #include <boost/serialization/base_object.hpp>
00035 #include <boost/shared_ptr.hpp>
00036 #include <boost/serialization/shared_ptr.hpp>
00037 #include <boost/serialization/version.hpp>
00038
00039
00040 #include "UblasVectorInclude.hpp"
00041
00042 #include "AbstractCardiacCellInterface.hpp"
00043 #include "AbstractOdeSystem.hpp"
00044 #include "AbstractIvpOdeSolver.hpp"
00045 #include "AbstractStimulusFunction.hpp"
00046
00047 #include <vector>
00048
00049 typedef enum _CellModelState
00050 {
00051 STATE_UNSET = 0,
00052 FAST_VARS_ONLY,
00053 ALL_VARS
00054 } CellModelState;
00055
00066 class AbstractCardiacCell : public AbstractCardiacCellInterface, public AbstractOdeSystem
00067 {
00068 private:
00070 friend class boost::serialization::access;
00077 template<class Archive>
00078 void serialize(Archive & archive, const unsigned int version)
00079 {
00080
00081 archive & boost::serialization::base_object<AbstractOdeSystem>(*this);
00082 if (version > 0)
00083 {
00084 archive & boost::serialization::base_object<AbstractCardiacCellInterface>(*this);
00085 }
00086 archive & mDt;
00087 archive & this->mSetVoltageDerivativeToZero;
00088 if (version > 0)
00089 {
00090
00091
00092
00093 archive & this->mIsUsedInTissue;
00094 archive & this->mHasDefaultStimulusFromCellML;
00095 }
00096
00097
00098
00099 if (version == 0)
00100 {
00101 CheckForArchiveFix();
00102 }
00103
00104 assert(this->mParameters.size() == this->rGetParameterNames().size());
00105 }
00106
00112 void CheckForArchiveFix();
00113
00114 protected:
00116 double mDt;
00117
00118 public:
00130 AbstractCardiacCell(boost::shared_ptr<AbstractIvpOdeSolver> pOdeSolver,
00131 unsigned numberOfStateVariables,
00132 unsigned voltageIndex,
00133 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00134
00136 virtual ~AbstractCardiacCell();
00137
00145 void Init();
00146
00152 void SetTimestep(double dt);
00153
00161 virtual void SolveAndUpdateState(double tStart, double tEnd);
00162
00171 virtual OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0);
00172
00180 virtual void ComputeExceptVoltage(double tStart, double tEnd);
00181
00185 void SetVoltage(double voltage);
00186
00191 double GetVoltage();
00192
00200 virtual double GetIntracellularCalciumConcentration();
00201
00209 virtual void SetStretch(double stretch)
00210 {
00211 }
00212
00219 virtual void VerifyStateVariables()
00220 {
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257 }
00258
00259
00260
00262
00264
00276 virtual void SetState(CellModelState state);
00277
00285 virtual void SetSlowValues(const std::vector<double> &rSlowValues);
00286
00294 virtual void GetSlowValues(std::vector<double>& rSlowValues);
00295
00300 virtual bool IsFastOnly();
00301
00314 virtual void AdjustOutOfRangeSlowValues(std::vector<double>& rSlowValues);
00315
00322 virtual unsigned GetNumSlowValues();
00323
00324 };
00325
00326 CLASS_IS_ABSTRACT(AbstractCardiacCell)
00327 BOOST_CLASS_VERSION(AbstractCardiacCell, 1)
00328
00329 #endif