WntCellCycleOdeSystem.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 #ifndef WNTCELLCYCLEODESYSTEM_HPP_
00029 #define WNTCELLCYCLEODESYSTEM_HPP_
00030 
00031 #include "ChasteSerialization.hpp"
00032 #include <boost/serialization/base_object.hpp>
00033 #include <boost/serialization/shared_ptr.hpp>
00034 
00035 #include <cmath>
00036 #include <iostream>
00037 
00038 #include "AbstractOdeSystem.hpp"
00039 #include "AbstractCellMutationState.hpp"
00040 
00041 // Needed here to avoid serialization errors
00042 #include "ApcOneHitCellMutationState.hpp"
00043 #include "ApcTwoHitCellMutationState.hpp"
00044 #include "BetaCateninOneHitCellMutationState.hpp"
00045 
00063 class WntCellCycleOdeSystem : public AbstractOdeSystem
00064 {
00065 private:
00066 
00072     double mk2d;
00074     double mk3d;
00076     double mk34d;
00078     double mk43d;
00080     double mk23d;
00082     double mad;
00084     double mJ11d;
00086     double mJ12d;
00088     double mJ13d;
00090     double mJ61d;
00092     double mJ62d;
00094     double mJ63d;
00096     double mKm1d;
00098     double mkpd;
00100     double mphi_r;
00102     double mphi_i;
00104     double mphi_j;
00106     double mphi_p;
00108     double ma2d;
00110     double ma3d;
00112     double ma4d;
00114     double ma5d;
00116     double mk16d;
00118     double mk61d;
00120     double mPhiE2F1;
00121 
00123     boost::shared_ptr<AbstractCellMutationState> mpMutationState;
00124 
00126     double mWntLevel;
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 
00150     WntCellCycleOdeSystem(double wntLevel=0.0,
00151                           boost::shared_ptr<AbstractCellMutationState> pMutationState=boost::shared_ptr<AbstractCellMutationState>(),
00152                           std::vector<double> stateVariables=std::vector<double>());
00153 
00157     ~WntCellCycleOdeSystem();
00158 
00162     void Init();
00163 
00172     void SetMutationState(boost::shared_ptr<AbstractCellMutationState> pMutationState);
00173 
00179     const boost::shared_ptr<AbstractCellMutationState> GetMutationState() const;
00180 
00191     void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
00192 
00202     bool CalculateStoppingEvent(double time, const std::vector<double>& rY);
00203 
00213     double CalculateRootFunction(double time, const std::vector<double>& rY);
00214 
00218     double GetWntLevel() const;
00219 };
00220 
00221 // Declare identifier for the serializer
00222 #include "SerializationExportWrapper.hpp"
00223 CHASTE_CLASS_EXPORT(WntCellCycleOdeSystem)
00224 
00225 namespace boost
00226 {
00227 namespace serialization
00228 {
00232 template<class Archive>
00233 inline void save_construct_data(
00234     Archive & ar, const WntCellCycleOdeSystem * t, const BOOST_PFTO unsigned int file_version)
00235 {
00236     // Save data required to construct instance
00237     const double wnt_level = t->GetWntLevel();
00238     ar & wnt_level;
00239 
00240     const boost::shared_ptr<AbstractCellMutationState> p_mutation_state = t->GetMutationState();
00241     ar & p_mutation_state;
00242 
00243     const std::vector<double> state_variables = t->rGetConstStateVariables();
00244     ar & state_variables;
00245 }
00246 
00250 template<class Archive>
00251 inline void load_construct_data(
00252     Archive & ar, WntCellCycleOdeSystem * t, const unsigned int file_version)
00253 {
00254     // Retrieve data from archive required to construct new instance
00255     double wnt_level;
00256     ar & wnt_level;
00257 
00258     boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
00259     ar & p_mutation_state;
00260 
00261     std::vector<double> state_variables;
00262     ar & state_variables;
00263 
00264     // Invoke inplace constructor to initialise instance
00265     ::new(t)WntCellCycleOdeSystem(wnt_level, p_mutation_state, state_variables);
00266 }
00267 }
00268 } // namespace ...
00269 
00270 #endif /*WNTCELLCYCLEODESYSTEM_HPP_*/

Generated on Mon Apr 18 11:35:28 2011 for Chaste by  doxygen 1.5.5