Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
Mirams2010WntOdeSystem.hpp
1/*
2
3Copyright (c) 2005-2024, University of Oxford.
4All rights reserved.
5
6University of Oxford means the Chancellor, Masters and Scholars of the
7University of Oxford, having an administrative office at Wellington
8Square, Oxford OX1 2JD, UK.
9
10This file is part of Chaste.
11
12Redistribution and use in source and binary forms, with or without
13modification, 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
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32OF 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
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{
62private:
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
100public:
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
162namespace boost
163{
164namespace serialization
165{
169template<class Archive>
170inline 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
187template<class Archive>
188inline 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_*/
gcov doesn't like this file...
#define CHASTE_CLASS_EXPORT(T)
void SetMutationState(boost::shared_ptr< AbstractCellMutationState > pMutationState)
void serialize(Archive &archive, const unsigned int version)
void EvaluateYDerivatives(double time, const std::vector< double > &rY, std::vector< double > &rDY)
const boost::shared_ptr< AbstractCellMutationState > GetMutationState() const
boost::shared_ptr< AbstractCellMutationState > mpMutationState