Chaste  Release::2017.1
CorriasBuistSMCModified.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 CorriasBuistSMCModified_HPP_
37 #define CorriasBuistSMCModified_HPP_
38 
39 
40 #include "ChasteSerialization.hpp"
41 #include <boost/serialization/base_object.hpp>
42 #include "AbstractCardiacCell.hpp"
43 #include "AbstractStimulusFunction.hpp"
59 {
60  friend class boost::serialization::access;
68  template<class Archive>
69  void serialize(Archive & archive, const unsigned int version)
70  {
71  archive & boost::serialization::base_object<AbstractCardiacCell >(*this);
72  }
73 
74 private:
75 
82 
87 
88  double Cm;
91  double Asurf;
93  double VolCell;
94  double hCa;
95  double sCa;
97  /* concentrations */
98  double Ki;
99  double Nai;
100  double ACh;
101  double CaiRest;
103  /* maximum conductances*/
104  double gLVA_max; // (0.18 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
105  double gCaL_max; // (65.0 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
106  double gBK_max; // (45.7 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
107  double gKb_max; // (0.0144 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
108  double gKA_max; // (9.0 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
109  double gKr_max; // (35.0 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
110  double gNa_max; // (3.0 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
111  double gnsCC_max; // (50.0 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
112  double gcouple; // 1.3 nS * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
113  double JCaExt_max;
115  /* Temperature corrections */
116  double Q10Ca;
117  double Q10K; //1.365
118  double Q10Na;
119  double Texp;
121  double T_correct_Ca ;
122  double T_correct_K ;
123  double T_correct_Na;
124  double T_correct_gBK; // (nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
125 
126  /* Nernst potentials */
127  double EK;
128  double ENa ;
129  double EnsCC;
131  double Ca_o;
132  double K_o;
133  double Na_o;
135  /* Nernst parameters */
136  double R;
137  double T;
138  double F;
139  double FoRT;
140  double RToF;
142 public:
143 
150  CorriasBuistSMCModified(boost::shared_ptr<AbstractIvpOdeSolver> pSolver, boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
151 
156 
160  void VerifyStateVariables();
161 
168  double GetIIonic(const std::vector<double>* pStateVariables=NULL);
169 
177  void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
178 
179 
186  void SetFakeIccStimulusPresent(bool present);
187 
192 
197 
204  void SetCarbonMonoxideScaleFactor(double scaleFactor);
205 
210 };
211 
212 // Needs to be included last
215 
216 namespace boost
217 {
218  namespace serialization
219  {
220  template<class Archive>
221  inline void save_construct_data(
222  Archive & ar, const CorriasBuistSMCModified * t, const unsigned int fileVersion)
223  {
224  const boost::shared_ptr<AbstractIvpOdeSolver> p_solver = t->GetSolver();
225  const boost::shared_ptr<AbstractStimulusFunction> p_stimulus = t->GetStimulusFunction();
226  ar << p_solver;
227  ar << p_stimulus;
228  }
229 
230  template<class Archive>
231  inline void load_construct_data(
232  Archive & ar, CorriasBuistSMCModified * t, const unsigned int fileVersion)
233  {
234  boost::shared_ptr<AbstractIvpOdeSolver> p_solver;
235  boost::shared_ptr<AbstractStimulusFunction> p_stimulus;
236  ar >> p_solver;
237  ar >> p_stimulus;
238  ::new(t)CorriasBuistSMCModified(p_solver, p_stimulus);
239  }
240  }
241 }
242 
243 #endif // CorriasBuistSMCModified_HPP_
double SetCarbonMonoxideScaleFactor()
const boost::shared_ptr< AbstractIvpOdeSolver > GetSolver() const
CorriasBuistSMCModified(boost::shared_ptr< AbstractIvpOdeSolver > pSolver, boost::shared_ptr< AbstractStimulusFunction > pIntracellularStimulus)
void EvaluateYDerivatives(double time, const std::vector< double > &rY, std::vector< double > &rDY)
void SetFakeIccStimulusPresent(bool present)
double GetIIonic(const std::vector< double > *pStateVariables=NULL)
boost::shared_ptr< AbstractStimulusFunction > GetStimulusFunction()
#define CHASTE_CLASS_EXPORT(T)
void serialize(Archive &archive, const unsigned int version)
gcov doesn&#39;t like this file...