Chaste Release::3.1
CorriasBuistSMCModified.hpp
00001 /*
00002 
00003 Copyright (c) 2005-2012, University of Oxford.
00004 All rights reserved.
00005 
00006 University of Oxford means the Chancellor, Masters and Scholars of the
00007 University of Oxford, having an administrative office at Wellington
00008 Square, Oxford OX1 2JD, UK.
00009 
00010 This file is part of Chaste.
00011 
00012 Redistribution and use in source and binary forms, with or without
00013 modification, are permitted provided that the following conditions are met:
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019  * Neither the name of the University of Oxford nor the names of its
00020    contributors may be used to endorse or promote products derived from this
00021    software without specific prior written permission.
00022 
00023 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00026 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00027 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00028 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00029 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00030 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00032 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 
00034 */
00035 
00036 #ifndef CorriasBuistSMCModified_HPP_
00037 #define CorriasBuistSMCModified_HPP_
00038 
00039 
00040 #include "ChasteSerialization.hpp"
00041 #include <boost/serialization/base_object.hpp>
00042 #include "AbstractCardiacCell.hpp"
00043 #include "AbstractStimulusFunction.hpp"
00058 class CorriasBuistSMCModified : public AbstractCardiacCell
00059 {
00060     friend class boost::serialization::access;
00061     template<class Archive>
00062     void serialize(Archive & archive, const unsigned int version)
00063     {
00064         archive & boost::serialization::base_object<AbstractCardiacCell >(*this);
00065     }
00066 
00067 private:
00068 
00074     double mScaleFactorCarbonMonoxide;
00075 
00079     bool mFakeIccStimulusPresent;
00080 
00081     double Cm;
00083     double Asurf_in_cm_square;
00084     double Asurf;
00086     double VolCell;
00087     double hCa;
00088     double sCa;
00090     /* concentrations */
00091     double Ki;       
00092     double Nai;        
00093     double ACh;       
00094     double CaiRest;     
00096     /* maximum conductances*/
00097     double gLVA_max;                  // (0.18 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00098     double gCaL_max;                  // (65.0 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00099     double gBK_max;                  // (45.7 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00100     double gKb_max;                   // (0.0144 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00101     double gKA_max;                   // (9.0  nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00102     double gKr_max;                   // (35.0 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00103     double gNa_max;                    // (3.0  nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00104     double gnsCC_max;                 // (50.0 nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00105     double gcouple;           // 1.3 nS * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00106     double JCaExt_max;     
00108     /* Temperature corrections */
00109     double Q10Ca;         
00110     double Q10K;          //1.365
00111     double Q10Na;        
00112     double Texp;       
00114     double T_correct_Ca ;
00115     double T_correct_K ;  
00116     double T_correct_Na;
00117     double T_correct_gBK;   // (nS) * 1e-6 (mS/nS) / Asurf (mm2) = mS/mm2
00118 
00119     /* Nernst potentials */
00120     double EK;                  
00121     double ENa ;               
00122     double EnsCC;                          
00124     double Ca_o;         
00125     double K_o;          
00126     double Na_o;         
00128     /* Nernst parameters */
00129     double R;    
00130     double T;       
00131     double F;     
00132     double FoRT;     
00133     double RToF;    
00135 public:
00136 
00143     CorriasBuistSMCModified(boost::shared_ptr<AbstractIvpOdeSolver> pSolver, boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00144 
00148     ~CorriasBuistSMCModified();
00149 
00153     void VerifyStateVariables();
00154 
00161     double GetIIonic(const std::vector<double>* pStateVariables=NULL);
00162 
00170     void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
00171 
00172 
00179     void SetFakeIccStimulusPresent(bool present);
00180 
00184     bool GetFakeIccStimulusPresent();
00185 
00189     double SetCarbonMonoxideScaleFactor();
00190 
00197     void SetCarbonMonoxideScaleFactor(double scaleFactor);
00198 
00202     double GetCarbonMonoxideScaleFactor();
00203 
00204 };
00205 
00206 
00207 // Needs to be included last
00208 #include "SerializationExportWrapper.hpp"
00209 CHASTE_CLASS_EXPORT(CorriasBuistSMCModified)
00210 
00211 namespace boost
00212 {
00213     namespace serialization
00214     {
00215         template<class Archive>
00216         inline void save_construct_data(
00217             Archive & ar, const CorriasBuistSMCModified * t, const unsigned int fileVersion)
00218         {
00219             const boost::shared_ptr<AbstractIvpOdeSolver> p_solver = t->GetSolver();
00220             const boost::shared_ptr<AbstractStimulusFunction> p_stimulus = t->GetStimulusFunction();
00221             ar << p_solver;
00222             ar << p_stimulus;
00223         }
00224 
00225         template<class Archive>
00226         inline void load_construct_data(
00227             Archive & ar, CorriasBuistSMCModified * t, const unsigned int fileVersion)
00228         {
00229             boost::shared_ptr<AbstractIvpOdeSolver> p_solver;
00230             boost::shared_ptr<AbstractStimulusFunction> p_stimulus;
00231             ar >> p_solver;
00232             ar >> p_stimulus;
00233             ::new(t)CorriasBuistSMCModified(p_solver, p_stimulus);
00234         }
00235 
00236     }
00237 
00238 }
00239 
00240 #endif // CorriasBuistSMCModified_HPP_