SingleOdeWntCellCycleModel.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 #ifndef SINGLEODEWNTCELLCYCLEMODEL_HPP_
00029 #define SINGLEODEWNTCELLCYCLEMODEL_HPP_
00030
00031 #include "ChasteSerialization.hpp"
00032 #include <boost/serialization/base_object.hpp>
00033 #include <boost/serialization/split_member.hpp>
00034 #include <boost/serialization/shared_ptr.hpp>
00035
00036 #include <cfloat>
00037
00038 #include "SimpleWntCellCycleModel.hpp"
00039 #include "Mirams2010WntOdeSystem.hpp"
00040 #include "RungeKutta4IvpOdeSolver.hpp"
00041 #include "CvodeAdaptor.hpp"
00042
00052 class SingleOdeWntCellCycleModel : public SimpleWntCellCycleModel
00053 {
00054 private:
00055 friend class boost::serialization::access;
00062 template<class Archive>
00063 void save(Archive & archive, const unsigned int version) const
00064 {
00065 assert(mpOdeSystem);
00066 archive & boost::serialization::base_object<SimpleWntCellCycleModel>(*this);
00075 boost::shared_ptr<AbstractCellMutationState> p_mutation_state = static_cast<Mirams2010WntOdeSystem*>(mpOdeSystem)->GetMutationState();
00076 archive & p_mutation_state;
00077 archive & mBetaCateninDivisionThreshold;
00078 archive & mLastTime;
00079 archive & mpOdeSystem->rGetStateVariables();
00080 }
00087 template<class Archive>
00088 void load(Archive & archive, const unsigned int version)
00089 {
00090
00091
00092
00093
00094 assert(mpOdeSystem);
00095 archive & boost::serialization::base_object<SimpleWntCellCycleModel>(*this);
00096 boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
00097 archive & p_mutation_state;
00098 static_cast<Mirams2010WntOdeSystem*>(mpOdeSystem)->SetMutationState(p_mutation_state);
00099
00100 archive & mBetaCateninDivisionThreshold;
00101 archive & mLastTime;
00102 archive & mpOdeSystem->rGetStateVariables();
00103 }
00104 BOOST_SERIALIZATION_SPLIT_MEMBER()
00105
00106
00109 Mirams2010WntOdeSystem* mpOdeSystem;
00110
00118 double mBetaCateninDivisionThreshold;
00119
00128 void ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel();
00129
00133 void UpdateBetaCateninLevel();
00134
00135 #ifdef CHASTE_CVODE
00136
00137 static CvodeAdaptor msSolver;
00138 #else
00139
00140 static RungeKutta4IvpOdeSolver msSolver;
00141 #endif //CHASTE_CVODE
00142
00144 double mLastTime;
00145
00146 public:
00147
00151 SingleOdeWntCellCycleModel()
00152 : mpOdeSystem(NULL),
00153 mLastTime(DBL_MAX)
00154 {
00155 #ifdef CHASTE_CVODE
00156 msSolver.SetMaxSteps(10000);
00157 #endif // CHASTE_CVODE
00158 };
00159
00168 SingleOdeWntCellCycleModel(std::vector<double>& rProteinConcs,
00169 boost::shared_ptr<AbstractCellMutationState> pMutationState,
00170 unsigned& rDimension,
00171 bool useTypeDependentG1 = false);
00172
00176 ~SingleOdeWntCellCycleModel();
00177
00186 SingleOdeWntCellCycleModel(const SingleOdeWntCellCycleModel& rOtherModel);
00187
00195 void Initialise();
00196
00200 void UpdateCellCyclePhase();
00201
00206 AbstractCellCycleModel* CreateCellCycleModel();
00207
00211 double GetBetaCateninConcentration();
00212
00218 void SetBetaCateninDivisionThreshold(double betaCateninDivisionThreshold);
00219
00223 double GetBetaCateninDivisionThreshold();
00224 };
00225
00226
00227 #include "SerializationExportWrapper.hpp"
00228 CHASTE_CLASS_EXPORT(SingleOdeWntCellCycleModel)
00229
00230 namespace boost
00231 {
00232 namespace serialization
00233 {
00238 template<class Archive>
00239 inline void save_construct_data(
00240 Archive & ar, const SingleOdeWntCellCycleModel * t, const unsigned int file_version)
00241 {
00242 }
00243
00248 template<class Archive>
00249 inline void load_construct_data(
00250 Archive & ar, SingleOdeWntCellCycleModel * t, const unsigned int file_version)
00251 {
00259 std::vector<double> state_vars;
00260 for (unsigned i=0; i<3; i++)
00261 {
00262 state_vars.push_back(0.0);
00263 }
00264
00265 boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
00266 unsigned dimension = 1;
00267 ::new(t)SingleOdeWntCellCycleModel(state_vars, p_mutation_state, dimension);
00268 }
00269 }
00270 }
00271
00272 #endif