TysonNovak2001OdeSystem.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 #ifndef TYSONNOVAK2001ODESYSTEM_HPP_
00030 #define TYSONNOVAK2001ODESYSTEM_HPP_
00031
00032 #include "ChasteSerialization.hpp"
00033 #include <boost/serialization/base_object.hpp>
00034
00035 #include <cmath>
00036 #include <iostream>
00037
00038 #include "AbstractOdeSystemWithAnalyticJacobian.hpp"
00039
00044 class TysonNovak2001OdeSystem : public AbstractOdeSystemWithAnalyticJacobian
00045 {
00046 private:
00047
00053 double mK1;
00055 double mK2d;
00057 double mK2dd;
00059 double mK2ddd;
00061 double mCycB_threshold;
00063 double mK3d;
00065 double mK3dd;
00067 double mK4d;
00069 double mK4;
00071 double mJ3;
00073 double mJ4;
00075 double mK5d;
00077 double mK5dd;
00079 double mK6;
00081 double mJ5;
00083 unsigned mN;
00085 double mK7;
00087 double mK8;
00089 double mJ7;
00091 double mJ8;
00093 double mMad;
00095 double mK9;
00097 double mK10;
00099 double mK11;
00101 double mK12d;
00103 double mK12dd;
00105 double mK12ddd;
00107 double mKeq;
00109 double mK13;
00111 double mK14;
00113 double mK15d;
00115 double mK15dd;
00117 double mK16d;
00119 double mK16dd;
00121 double mJ15;
00123 double mJ16;
00125 double mMu;
00127 double mMstar;
00128
00129 friend class boost::serialization::access;
00136 template<class Archive>
00137 void serialize(Archive & archive, const unsigned int version)
00138 {
00139 archive & boost::serialization::base_object<AbstractOdeSystem>(*this);
00140 }
00141
00142 public:
00143
00149 TysonNovak2001OdeSystem(std::vector<double> stateVariables=std::vector<double>());
00150
00154 ~TysonNovak2001OdeSystem();
00155
00159 void Init();
00160
00171 void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
00172
00182 bool CalculateStoppingEvent(double time, const std::vector<double>& rY);
00183
00193 double CalculateRootFunction(double time, const std::vector<double>& rY);
00194
00203 virtual void AnalyticJacobian(const std::vector<double>& rSolutionGuess, double** jacobian, double time, double timeStep);
00204 };
00205
00206
00207 #include "SerializationExportWrapper.hpp"
00208 CHASTE_CLASS_EXPORT(TysonNovak2001OdeSystem)
00209
00210 namespace boost
00211 {
00212 namespace serialization
00213 {
00217 template<class Archive>
00218 inline void save_construct_data(
00219 Archive & ar, const TysonNovak2001OdeSystem * t, const BOOST_PFTO unsigned int file_version)
00220 {
00221
00222 const std::vector<double> state_variables = t->rGetConstStateVariables();
00223 ar & state_variables;
00224 }
00225
00229 template<class Archive>
00230 inline void load_construct_data(
00231 Archive & ar, TysonNovak2001OdeSystem * t, const unsigned int file_version)
00232 {
00233
00234 std::vector<double> state_variables;
00235 ar & state_variables;
00236
00237
00238 ::new(t)TysonNovak2001OdeSystem(state_variables);
00239 }
00240 }
00241 }
00242
00243 #endif