Chaste Release::3.1
CorriasBuistICCModified.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 CorriasBuistICCModified_HPP_
00037 #define CorriasBuistICCModified_HPP_
00038 
00039 #include "ChasteSerialization.hpp"
00040 #include <boost/serialization/base_object.hpp>
00041 #include "AbstractCardiacCell.hpp"
00042 #include "AbstractStimulusFunction.hpp"
00043 
00059 class CorriasBuistICCModified : public AbstractCardiacCell
00060 {
00061     friend class boost::serialization::access;
00062     template<class Archive>
00063     void serialize(Archive & archive, const unsigned int version)
00064     {
00065         archive & boost::serialization::base_object<AbstractCardiacCell >(*this);
00066         archive &  mFractionOfVDDRInPU;
00067         archive &  mIP3Concentration;
00068         archive &  mScaleFactorSerca;
00069         archive &  mScaleFactorCarbonMonoxide;
00070     }
00071 
00072 private:
00073 
00075     double mFractionOfVDDRInPU;
00077     double mIP3Concentration;
00079     double mScaleFactorSerca;
00085     double mScaleFactorCarbonMonoxide;
00086 
00087     /* Concentrations */
00088     double Ca_o;
00089     double Cl_o;
00090     double K_o;
00091     double Na_o;
00093     /* Nernst parameters */
00094     double R;
00095     double T;
00096     double F;
00097     double FoRT;
00098     double RToF;
00100     double  Cm ;
00101     double Asurf_in_cm_square;
00102     double  Asurf ;
00103     double  Cl_i  ;
00104     double  K_i   ;
00105     double  Na_i    ;
00106     double  P_cyto;
00107     double  Vol  ;
00108     double  fc ;
00109     double  fe  ;
00110     double  fm ;
00111     double  Q10Ca ;
00112     double  Q10K ;
00113     double  Q10Na  ;
00114     double  T_exp  ;
00116     double  G_max_BK  ;
00117     double  G_max_CaCl  ;
00118     double  G_max_ERG  ;
00119     double  G_max_Ltype ;
00120     double  G_max_NSCC  ;
00121     double  G_max_Na ;
00122     double  G_max_VDDR ;
00123     double  G_max_bk    ;
00124     double  G_max_kv11 ;
00127     double  J_max_PMCA  ;
00128     double  J_max_PMCA_PU ;
00129     double  J_ERleak   ;
00130     double  J_max_leak ;
00131     double  Jmax_IP3  ;
00132     double  Jmax_NaCa ;
00133     double  Jmax_serca   ;
00134     double  Jmax_uni    ;
00136     double  NaPerm_o_Kperm   ;
00137     double  L    ;
00138     double  P_ER  ;
00139     double  P_PU   ;
00140     double  P_mito ;
00141     double  b ;
00142     double  na ;
00144     double  K_Ca   ;
00145     double  K_Na ;
00146     double  K_act ;
00147     double  K_trans   ;
00148     double  k_serca ;
00149     double  conc   ;
00150     double  d_ACT   ;
00151     double  d_IP3 ;
00152     double  d_INH  ;
00154     double  tau_d_CaCl;
00155     double  tau_d_NSCC ;
00156     double  tauh;
00158     double  deltaPsi_B;
00159     double  deltaPsi_star;
00160     double  deltaPsi;
00163 
00164      //Calculated constants
00166      /* Volumes */
00167      double V_cyto;              
00168      double V_ER;                
00169      double V_MITO;              
00170      double V_PU;                
00172      /* Temperature corrections */
00173      double T_correction_Ca;     
00174      double T_correction_K;      
00175      double T_correction_Na;     
00176      double T_correction_BK;     
00178      /* Nernst potentials */
00179      double E_Na;                
00180      double E_K;                 
00181      double E_Cl;                
00182      double E_NSCC;              
00184      /* Activation gate time constants */
00185      double tau_d_ERG;           
00186      double tau_d_Ltype;         
00187      double tau_d_Na;            
00188      double tau_d_VDDR;          
00189      double tau_d_kv11;          
00191      /* Inactivation gate time constants */
00192      double tau_f_Ltype;         
00193      double tau_f_Na;            
00194      double tau_f_VDDR;          
00195      double tau_f_ca_Ltype;      
00196      double tau_f_kv11;          
00198      /* Speed ups */
00199      double e2FoRTdPsiMdPsiS;
00200      double ebFoRTdPsiMdPsiS;
00203 public:
00210      CorriasBuistICCModified(boost::shared_ptr<AbstractIvpOdeSolver> pSolver, boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00211 
00215     ~CorriasBuistICCModified();
00216 
00220     void VerifyStateVariables();
00221 
00228     double GetIIonic(const std::vector<double>* pStateVariables=NULL);
00229 
00237     void EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY);
00238 
00244     void SetFractionOfVDDRInPU(double fraction);
00245 
00251     void SetIP3Concentration(double concentration);
00252 
00258     void SetSercaPumpScaleFactor(double scaleFactor);
00259 
00266     void SetCarbonMonoxideScaleFactor(double scaleFactor);
00267 
00271     double GetCarbonMonoxideScaleFactor();
00272 };
00273 
00274 
00275 // Needs to be included last
00276 #include "SerializationExportWrapper.hpp"
00277 CHASTE_CLASS_EXPORT(CorriasBuistICCModified)
00278 
00279 namespace boost
00280 {
00281     namespace serialization
00282     {
00283         template<class Archive>
00284         inline void save_construct_data(
00285             Archive & ar, const CorriasBuistICCModified * t, const unsigned int fileVersion)
00286         {
00287             const boost::shared_ptr<AbstractIvpOdeSolver> p_solver = t->GetSolver();
00288             const boost::shared_ptr<AbstractStimulusFunction> p_stimulus = t->GetStimulusFunction();
00289             ar << p_solver;
00290             ar << p_stimulus;
00291         }
00292 
00293         template<class Archive>
00294         inline void load_construct_data(
00295             Archive & ar, CorriasBuistICCModified * t, const unsigned int fileVersion)
00296         {
00297             boost::shared_ptr<AbstractIvpOdeSolver> p_solver;
00298             boost::shared_ptr<AbstractStimulusFunction> p_stimulus;
00299             ar >> p_solver;
00300             ar >> p_stimulus;
00301             ::new(t)CorriasBuistICCModified(p_solver, p_stimulus);
00302         }
00303 
00304     }
00305 
00306 }
00307 
00308 #endif // CorriasBuistICCModified_HPP_