Chaste  Release::2017.1
VanLeeuwen2009WntSwatCellCycleOdeSystem.hpp
1 /*
2 
3 Copyright (c) 2005-2017, University of Oxford.
4 All rights reserved.
5 
6 University of Oxford means the Chancellor, Masters and Scholars of the
7 University of Oxford, having an administrative office at Wellington
8 Square, Oxford OX1 2JD, UK.
9 
10 This file is part of Chaste.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #ifndef VANLEEUWEN2009WNTSWATCELLCYCLEODESYSTEM_HPP_
37 #define VANLEEUWEN2009WNTSWATCELLCYCLEODESYSTEM_HPP_
38 
39 #include "ChasteSerialization.hpp"
40 #include <boost/serialization/base_object.hpp>
41 #include <boost/serialization/shared_ptr.hpp>
42 
43 #include <cmath>
44 #include <iostream>
45 
46 #include "AbstractOdeSystem.hpp"
47 #include "AbstractCellMutationState.hpp"
48 #include "MathsCustomFunctions.hpp"
49 
82 {
83 private:
84 
90  double mk2d;
92  double mk3d;
94  double mk34d;
96  double mk43d;
98  double mk23d;
100  double mad;
102  double mJ11d;
104  double mJ12d;
106  double mJ13d;
108  double mJ61d;
110  double mJ62d;
112  double mJ63d;
114  double mKm1d;
116  double mkpd;
118  double mphi_r;
120  double mphi_i;
122  double mphi_j;
124  double mphi_p;
126  double mk16d;
128  double mk61d;
130  double mPhiE2F1;
131 
137  double mSa;
139  double mSca;
141  double mSc;
143  double mSct;
145  double mSd;
147  double mSt;
149  double mSx;
151  double mSy;
153  double mDa;
155  double mDca;
157  double mDc;
159  double mDct;
161  double mDd;
163  double mDdx;
165  double mDt;
167  double mDu;
169  double mDx;
171  double mDy;
173  double mKc;
175  double mKd;
177  double mKt;
179  double mPc;
181  double mPu;
183  double mXiD;
185  double mXiDx;
187  double mXiX;
189  double mXiC;
190 
192  boost::shared_ptr<AbstractCellMutationState> mpMutationState;
193 
199  unsigned mHypothesis;
200 
202  double mWntLevel;
203 
204  friend class boost::serialization::access;
211  template<class Archive>
212  void serialize(Archive & archive, const unsigned int version)
213  {
214  archive & boost::serialization::base_object<AbstractOdeSystem>(*this);
215  }
216 
217 public:
218 
227  VanLeeuwen2009WntSwatCellCycleOdeSystem(unsigned hypothesis,
228  double wntLevel = 0.0,
229  boost::shared_ptr<AbstractCellMutationState> pMutationState=boost::shared_ptr<AbstractCellMutationState>(),
230  std::vector<double> stateVariables=std::vector<double>());
231 
236 
240  void Init();
241 
250  void SetMutationState(boost::shared_ptr<AbstractCellMutationState> pMutationState);
251 
257  const boost::shared_ptr<AbstractCellMutationState> GetMutationState() const;
258 
269  void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
270 
279  bool CalculateStoppingEvent(double time, const std::vector<double>& rY);
280 
290  double CalculateRootFunction(double time, const std::vector<double>& rY);
291 
295  double GetWntLevel() const;
296 
300  unsigned GetHypothesis() const;
301 };
302 
303 // Declare identifier for the serializer
306 
307 namespace boost
308 {
309 namespace serialization
310 {
314 template<class Archive>
315 inline void save_construct_data(
316  Archive & ar, const VanLeeuwen2009WntSwatCellCycleOdeSystem * t, const unsigned int file_version)
317 {
318  // Save data required to construct instance
319  const unsigned hypothesis = t->GetHypothesis();
320  ar & hypothesis;
321 
322  const double wnt_level = t->GetWntLevel();
323  ar & wnt_level;
324 
325  const boost::shared_ptr<AbstractCellMutationState> p_mutation_state = t->GetMutationState();
326  ar & p_mutation_state;
327 
328  const std::vector<double>& state_variables = t->rGetConstStateVariables();
329  ar & state_variables;
330 }
331 
335 template<class Archive>
336 inline void load_construct_data(
337  Archive & ar, VanLeeuwen2009WntSwatCellCycleOdeSystem * t, const unsigned int file_version)
338 {
339  // Retrieve data from archive required to construct new instance
340  unsigned hypothesis;
341  ar & hypothesis;
342 
343  double wnt_level;
344  ar & wnt_level;
345 
346  boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
347  ar & p_mutation_state;
348 
349  std::vector<double> state_variables;
350  ar & state_variables;
351 
352  // Invoke inplace constructor to initialise instance
353  ::new(t)VanLeeuwen2009WntSwatCellCycleOdeSystem(hypothesis, wnt_level, p_mutation_state, state_variables);
354 }
355 }
356 } // namespace ...
357 
358 #endif /*VANLEEUWEN2009WNTSWATCELLCYCLEODESYSTEM_HPP_*/
VanLeeuwen2009WntSwatCellCycleOdeSystem(unsigned hypothesis, double wntLevel=0.0, boost::shared_ptr< AbstractCellMutationState > pMutationState=boost::shared_ptr< AbstractCellMutationState >(), std::vector< double > stateVariables=std::vector< double >())
boost::shared_ptr< AbstractCellMutationState > mpMutationState
const std::vector< double > & rGetConstStateVariables() const
void serialize(Archive &archive, const unsigned int version)
const boost::shared_ptr< AbstractCellMutationState > GetMutationState() const
double CalculateRootFunction(double time, const std::vector< double > &rY)
bool CalculateStoppingEvent(double time, const std::vector< double > &rY)
void SetMutationState(boost::shared_ptr< AbstractCellMutationState > pMutationState)
#define CHASTE_CLASS_EXPORT(T)
void EvaluateYDerivatives(double time, const std::vector< double > &rY, std::vector< double > &rDY)
gcov doesn&#39;t like this file...