Chaste  Release::2017.1
WntCellCycleOdeSystem.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 WNTCELLCYCLEODESYSTEM_HPP_
37 #define WNTCELLCYCLEODESYSTEM_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 
67 {
68 private:
69 
75  double mk2d;
77  double mk3d;
79  double mk34d;
81  double mk43d;
83  double mk23d;
85  double mad;
87  double mJ11d;
89  double mJ12d;
91  double mJ13d;
93  double mJ61d;
95  double mJ62d;
97  double mJ63d;
99  double mKm1d;
101  double mkpd;
103  double mphi_r;
105  double mphi_i;
107  double mphi_j;
109  double mphi_p;
111  double ma2d;
113  double ma3d;
115  double ma4d;
117  double ma5d;
119  double mk16d;
121  double mk61d;
123  double mPhiE2F1;
124 
126  boost::shared_ptr<AbstractCellMutationState> mpMutationState;
127 
129  double mWntLevel;
130 
131  friend class boost::serialization::access;
138  template<class Archive>
139  void serialize(Archive & archive, const unsigned int version)
140  {
141  archive & boost::serialization::base_object<AbstractOdeSystem>(*this);
142  }
143 
144 public:
145 
153  WntCellCycleOdeSystem(double wntLevel=0.0,
154  boost::shared_ptr<AbstractCellMutationState> pMutationState=boost::shared_ptr<AbstractCellMutationState>(),
155  std::vector<double> stateVariables=std::vector<double>());
156 
161 
165  void Init();
166 
175  void SetMutationState(boost::shared_ptr<AbstractCellMutationState> pMutationState);
176 
182  const boost::shared_ptr<AbstractCellMutationState> GetMutationState() const;
183 
194  void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
195 
205  bool CalculateStoppingEvent(double time, const std::vector<double>& rY);
206 
216  double CalculateRootFunction(double time, const std::vector<double>& rY);
217 
221  double GetWntLevel() const;
222 };
223 
224 // Declare identifier for the serializer
227 
228 namespace boost
229 {
230 namespace serialization
231 {
235 template<class Archive>
236 inline void save_construct_data(
237  Archive & ar, const WntCellCycleOdeSystem * t, const unsigned int file_version)
238 {
239  // Save data required to construct instance
240  const double wnt_level = t->GetWntLevel();
241  ar & wnt_level;
242 
243  const boost::shared_ptr<AbstractCellMutationState> p_mutation_state = t->GetMutationState();
244  ar & p_mutation_state;
245 
246  const std::vector<double>& state_variables = t->rGetConstStateVariables();
247  ar & state_variables;
248 }
249 
253 template<class Archive>
254 inline void load_construct_data(
255  Archive & ar, WntCellCycleOdeSystem * t, const unsigned int file_version)
256 {
257  // Retrieve data from archive required to construct new instance
258  double wnt_level;
259  ar & wnt_level;
260 
261  boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
262  ar & p_mutation_state;
263 
264  std::vector<double> state_variables;
265  ar & state_variables;
266 
267  // Invoke inplace constructor to initialise instance
268  ::new(t)WntCellCycleOdeSystem(wnt_level, p_mutation_state, state_variables);
269 }
270 }
271 } // namespace ...
272 
273 #endif /*WNTCELLCYCLEODESYSTEM_HPP_*/
double CalculateRootFunction(double time, const std::vector< double > &rY)
const std::vector< double > & rGetConstStateVariables() const
void SetMutationState(boost::shared_ptr< AbstractCellMutationState > pMutationState)
bool CalculateStoppingEvent(double time, const std::vector< double > &rY)
WntCellCycleOdeSystem(double wntLevel=0.0, boost::shared_ptr< AbstractCellMutationState > pMutationState=boost::shared_ptr< AbstractCellMutationState >(), std::vector< double > stateVariables=std::vector< double >())
#define CHASTE_CLASS_EXPORT(T)
const boost::shared_ptr< AbstractCellMutationState > GetMutationState() const
void serialize(Archive &archive, const unsigned int version)
gcov doesn&#39;t like this file...
boost::shared_ptr< AbstractCellMutationState > mpMutationState
void EvaluateYDerivatives(double time, const std::vector< double > &rY, std::vector< double > &rDY)