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 
00029 #ifndef WNTCELLCYCLEODESYSTEM_HPP_
00030 #define WNTCELLCYCLEODESYSTEM_HPP_
00031 
00032 #include "ChasteSerialization.hpp"
00033 #include <boost/serialization/base_object.hpp>
00034 #include <boost/serialization/shared_ptr.hpp>
00035 
00036 #include <cmath>
00037 #include <iostream>
00038 
00039 #include "AbstractOdeSystem.hpp"
00040 #include "AbstractCellMutationState.hpp"
00041 
00042 // Needed here to avoid serialization errors
00043 #include "ApcOneHitCellMutationState.hpp"
00044 #include "ApcTwoHitCellMutationState.hpp"
00045 #include "BetaCateninOneHitCellMutationState.hpp"
00046 
00064 class WntCellCycleOdeSystem : public AbstractOdeSystem
00065 {
00066 private:
00067 
00073     double mk2d;
00075     double mk3d;
00077     double mk34d;
00079     double mk43d;
00081     double mk23d;
00083     double mad;
00085     double mJ11d;
00087     double mJ12d;
00089     double mJ13d;
00091     double mJ61d;
00093     double mJ62d;
00095     double mJ63d;
00097     double mKm1d;
00099     double mkpd;
00101     double mphi_r;
00103     double mphi_i;
00105     double mphi_j;
00107     double mphi_p;
00109     double ma2d;
00111     double ma3d;
00113     double ma4d;
00115     double ma5d;
00117     double mk16d;
00119     double mk61d;
00121     double mPhiE2F1;
00122 
00124     boost::shared_ptr<AbstractCellMutationState> mpMutationState;
00125 
00127     double mWntLevel;
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 
00151     WntCellCycleOdeSystem(double wntLevel=0.0,
00152                           boost::shared_ptr<AbstractCellMutationState> pMutationState=boost::shared_ptr<AbstractCellMutationState>(),
00153                           std::vector<double> stateVariables=std::vector<double>());
00154 
00158     ~WntCellCycleOdeSystem();
00159 
00163     void Init();
00164 
00173     void SetMutationState(boost::shared_ptr<AbstractCellMutationState> pMutationState);
00174 
00180     const boost::shared_ptr<AbstractCellMutationState> GetMutationState() const;
00181 
00192     void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
00193 
00203     bool CalculateStoppingEvent(double time, const std::vector<double>& rY);
00204 
00214     double CalculateRootFunction(double time, const std::vector<double>& rY);
00215 
00219     double GetWntLevel() const;
00220 };
00221 
00222 // Declare identifier for the serializer
00223 #include "SerializationExportWrapper.hpp"
00224 CHASTE_CLASS_EXPORT(WntCellCycleOdeSystem)
00225 
00226 namespace boost
00227 {
00228 namespace serialization
00229 {
00233 template<class Archive>
00234 inline void save_construct_data(
00235     Archive & ar, const WntCellCycleOdeSystem * t, const BOOST_PFTO unsigned int file_version)
00236 {
00237     // Save data required to construct instance
00238     const double wnt_level = t->GetWntLevel();
00239     ar & wnt_level;
00240 
00241     const boost::shared_ptr<AbstractCellMutationState> p_mutation_state = t->GetMutationState();
00242     ar & p_mutation_state;
00243 
00244     const std::vector<double> state_variables = t->rGetConstStateVariables();
00245     ar & state_variables;
00246 }
00247 
00251 template<class Archive>
00252 inline void load_construct_data(
00253     Archive & ar, WntCellCycleOdeSystem * t, const unsigned int file_version)
00254 {
00255     // Retrieve data from archive required to construct new instance
00256     double wnt_level;
00257     ar & wnt_level;
00258 
00259     boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
00260     ar & p_mutation_state;
00261 
00262     std::vector<double> state_variables;
00263     ar & state_variables;
00264 
00265     // Invoke inplace constructor to initialise instance
00266     ::new(t)WntCellCycleOdeSystem(wnt_level, p_mutation_state, state_variables);
00267 }
00268 }
00269 } // namespace ...
00270 
00271 #endif /*WNTCELLCYCLEODESYSTEM_HPP_*/
Generated on Thu Dec 22 13:00:05 2011 for Chaste by  doxygen 1.6.3