AbstractCvodeCell.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 #ifdef CHASTE_CVODE
00037 #ifndef _ABSTRACTCVODECELL_HPP_
00038 #define _ABSTRACTCVODECELL_HPP_
00039
00040
00041 #include "ChasteSerialization.hpp"
00042 #include "ClassIsAbstract.hpp"
00043 #include <boost/serialization/base_object.hpp>
00044 #include <boost/shared_ptr.hpp>
00045 #include <boost/serialization/shared_ptr.hpp>
00046
00047
00048 #include "AbstractOdeSystemInformation.hpp"
00049 #include "AbstractStimulusFunction.hpp"
00050 #include "AbstractIvpOdeSolver.hpp"
00051 #include "AbstractCvodeSystem.hpp"
00052 #include "AbstractCardiacCellInterface.hpp"
00053 #include "VectorHelperFunctions.hpp"
00054
00055
00078 class AbstractCvodeCell : public AbstractCardiacCellInterface, public AbstractCvodeSystem
00079 {
00080 private:
00082 friend class boost::serialization::access;
00089 template<class Archive>
00090 void serialize(Archive & archive, const unsigned int version)
00091 {
00092
00093 archive & boost::serialization::base_object<AbstractCvodeSystem>(*this);
00094 archive & boost::serialization::base_object<AbstractCardiacCellInterface>(*this);
00095 archive & mMaxDt;
00096 }
00097
00098 protected:
00100 double mMaxDt;
00101
00102 public:
00113 AbstractCvodeCell(boost::shared_ptr<AbstractIvpOdeSolver> pSolver,
00114 unsigned numberOfStateVariables,
00115 unsigned voltageIndex,
00116 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00117
00121 virtual ~AbstractCvodeCell();
00122
00127 double GetVoltage();
00128
00133 void SetVoltage(double voltage);
00134
00140 void SetMaxTimestep(double maxDt);
00141
00151 void SetTimestep(double maxDt);
00152
00156 double GetTimestep();
00157
00168 virtual void SolveAndUpdateState(double tStart, double tEnd);
00169
00183 OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0);
00184
00192 void ComputeExceptVoltage(double tStart, double tEnd);
00193
00199 void SetVoltageDerivativeToZero(bool clamp=true);
00200
00210 unsigned GetNumberOfStateVariables() const;
00211
00221 unsigned GetNumberOfParameters() const;
00222
00232 std::vector<double> GetStdVecStateVariables();
00233
00243 const std::vector<std::string>& rGetStateVariableNames() const;
00244
00254 void SetStateVariables(const std::vector<double>& rVariables);
00255
00260 void SetStateVariables(const N_Vector& rVariables);
00261
00272 void SetStateVariable(unsigned index, double newValue);
00273
00284 void SetStateVariable(const std::string& rName, double newValue);
00285
00297 double GetAnyVariable(const std::string& rName, double time=0.0);
00298
00309 double GetParameter(const std::string& rParameterName);
00310
00319 double GetParameter(unsigned parameterIndex);
00320
00331 void SetParameter(const std::string& rParameterName, double value);
00332
00333 };
00334
00335 CLASS_IS_ABSTRACT(AbstractCvodeCell)
00336
00337 #endif // _ABSTRACTCVODECELL_HPP_
00338 #endif // CHASTE_CVODE