TysonNovak2001OdeSystem.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
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 #ifndef TYSONNOVAK2001ODESYSTEM_HPP_
00029 #define TYSONNOVAK2001ODESYSTEM_HPP_
00030 
00031 #include "ChasteSerialization.hpp"
00032 #include <boost/serialization/base_object.hpp>
00033 
00034 #include <cmath>
00035 #include <iostream>
00036 
00037 #include "AbstractOdeSystemWithAnalyticJacobian.hpp"
00038 
00043 class TysonNovak2001OdeSystem : public AbstractOdeSystemWithAnalyticJacobian
00044 {
00045 private:
00046 
00052     double mK1;
00054     double mK2d;
00056     double mK2dd;
00058     double mK2ddd;
00060     double mCycB_threshold;
00062     double mK3d;
00064     double mK3dd;
00066     double mK4d;
00068     double mK4;
00070     double mJ3;
00072     double mJ4;
00074     double mK5d;
00076     double mK5dd;
00078     double mK6;
00080     double mJ5;
00082     unsigned mN;
00084     double mK7;
00086     double mK8;
00088     double mJ7;
00090     double mJ8;
00092     double mMad;
00094     double mK9;
00096     double mK10;
00098     double mK11;
00100     double mK12d;
00102     double mK12dd;
00104     double mK12ddd;
00106     double mKeq;
00108     double mK13;
00110     double mK14;
00112     double mK15d;
00114     double mK15dd;
00116     double mK16d;
00118     double mK16dd;
00120     double mJ15;
00122     double mJ16;
00124     double mMu;
00126     double mMstar;
00127 
00128     friend class boost::serialization::access;
00135     template<class Archive>
00136     void serialize(Archive & archive, const unsigned int version)
00137     {
00138         archive & boost::serialization::base_object<AbstractOdeSystem>(*this);
00139     }
00140 
00141 public:
00142 
00148     TysonNovak2001OdeSystem(std::vector<double> stateVariables=std::vector<double>());
00149 
00153     ~TysonNovak2001OdeSystem();
00154 
00158     void Init();
00159 
00170     void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
00171 
00181     bool CalculateStoppingEvent(double time, const std::vector<double>& rY);
00182 
00192     double CalculateRootFunction(double time, const std::vector<double>& rY);
00193 
00202     virtual void AnalyticJacobian(const std::vector<double>& rSolutionGuess, double** jacobian, double time, double timeStep);
00203 };
00204 
00205 // Declare identifier for the serializer
00206 #include "SerializationExportWrapper.hpp"
00207 CHASTE_CLASS_EXPORT(TysonNovak2001OdeSystem)
00208 
00209 namespace boost
00210 {
00211 namespace serialization
00212 {
00216 template<class Archive>
00217 inline void save_construct_data(
00218     Archive & ar, const TysonNovak2001OdeSystem * t, const BOOST_PFTO unsigned int file_version)
00219 {
00220     // Save data required to construct instance
00221     const std::vector<double> state_variables = t->rGetConstStateVariables();
00222     ar & state_variables;
00223 }
00224 
00228 template<class Archive>
00229 inline void load_construct_data(
00230     Archive & ar, TysonNovak2001OdeSystem * t, const unsigned int file_version)
00231 {
00232     // Retrieve data from archive required to construct new instance
00233     std::vector<double> state_variables;
00234     ar & state_variables;
00235 
00236     // Invoke inplace constructor to initialise instance
00237     ::new(t)TysonNovak2001OdeSystem(state_variables);
00238 }
00239 }
00240 } // namespace ...
00241 
00242 #endif /*TYSONNOVAK2001ODESYSTEM_HPP_*/

Generated on Mon Nov 1 12:35:16 2010 for Chaste by  doxygen 1.5.5