TysonNovak2001OdeSystem.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
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 // Declare identifier for the serializer
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     // Save data required to construct instance
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     // Retrieve data from archive required to construct new instance
00234     std::vector<double> state_variables;
00235     ar & state_variables;
00236 
00237     // Invoke inplace constructor to initialise instance
00238     ::new(t)TysonNovak2001OdeSystem(state_variables);
00239 }
00240 }
00241 } // namespace ...
00242 
00243 #endif /*TYSONNOVAK2001ODESYSTEM_HPP_*/
Generated on Thu Dec 22 13:00:04 2011 for Chaste by  doxygen 1.6.3