Chaste  Release::3.4
Mirams2010WntOdeSystem.hpp
1 /*
2 
3 Copyright (c) 2005-2016, 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 MIRAMS2010WNTODESYSTEM_HPP_
37 #define MIRAMS2010WNTODESYSTEM_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 
61 {
62 private:
63 
69  double mA;
71  double mB;
73  double mC;
75  double mD;
77  double mE;
79  double mF;
80 
82  boost::shared_ptr<AbstractCellMutationState> mpMutationState;
83 
85  double mWntLevel;
86 
87  friend class boost::serialization::access;
94  template<class Archive>
95  void serialize(Archive & archive, const unsigned int version)
96  {
97  archive & boost::serialization::base_object<AbstractOdeSystem>(*this);
98  }
99 
100 public:
101 
109  Mirams2010WntOdeSystem(double wntLevel=0.0,
110  boost::shared_ptr<AbstractCellMutationState> pMutationState=boost::shared_ptr<AbstractCellMutationState>(),
111  std::vector<double> stateVariables=std::vector<double>());
112 
117 
121  void Init();
122 
131  void SetMutationState(boost::shared_ptr<AbstractCellMutationState> pMutationState);
132 
138  const boost::shared_ptr<AbstractCellMutationState> GetMutationState() const;
139 
150  void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
151 
155  double GetWntLevel() const;
156 };
157 
158 // Declare identifier for the serializer
161 
162 namespace boost
163 {
164 namespace serialization
165 {
169 template<class Archive>
170 inline void save_construct_data(
171  Archive & ar, const Mirams2010WntOdeSystem * t, const unsigned int file_version)
172 {
173  // Save data required to construct instance
174  const double wnt_level = t->GetWntLevel();
175  ar & wnt_level;
176 
177  const boost::shared_ptr<AbstractCellMutationState> p_mutation_state = t->GetMutationState();
178  ar & p_mutation_state;
179 
180  const std::vector<double> state_variables = t->rGetConstStateVariables();
181  ar & state_variables;
182 }
183 
187 template<class Archive>
188 inline void load_construct_data(
189  Archive & ar, Mirams2010WntOdeSystem * t, const unsigned int file_version)
190 {
191  // Retrieve data from archive required to construct new instance
192  double wnt_level;
193  ar & wnt_level;
194 
195  boost::shared_ptr<AbstractCellMutationState> p_mutation_state;
196  ar & p_mutation_state;
197 
198  std::vector<double> state_variables;
199  ar & state_variables;
200 
201  // Invoke inplace constructor to initialise instance
202  ::new(t)Mirams2010WntOdeSystem(wnt_level, p_mutation_state, state_variables);
203 }
204 }
205 } // namespace ...
206 
207 #endif /*MIRAMS2010WNTODESYSTEM_HPP_*/
Mirams2010WntOdeSystem(double wntLevel=0.0, boost::shared_ptr< AbstractCellMutationState > pMutationState=boost::shared_ptr< AbstractCellMutationState >(), std::vector< double > stateVariables=std::vector< double >())
const std::vector< double > & rGetConstStateVariables() const
void SetMutationState(boost::shared_ptr< AbstractCellMutationState > pMutationState)
const boost::shared_ptr< AbstractCellMutationState > GetMutationState() const
#define CHASTE_CLASS_EXPORT(T)
void EvaluateYDerivatives(double time, const std::vector< double > &rY, std::vector< double > &rDY)
boost::shared_ptr< AbstractCellMutationState > mpMutationState
void serialize(Archive &archive, const unsigned int version)