00001 /* 00002 00003 Copyright (C) University of Oxford, 2005-2011 00004 00005 University of Oxford means the Chancellor, Masters and Scholars of the 00006 University of Oxford, having an administrative office at Wellington 00007 Square, Oxford OX1 2JD, UK. 00008 00009 This file is part of Chaste. 00010 00011 Chaste is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU Lesser General Public License as published 00013 by the Free Software Foundation, either version 2.1 of the License, or 00014 (at your option) any later version. 00015 00016 Chaste is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00019 License for more details. The offer of Chaste under the terms of the 00020 License is subject to the License being interpreted in accordance with 00021 English Law and subject to any action against the University of Oxford 00022 being under the jurisdiction of the English Courts. 00023 00024 You should have received a copy of the GNU Lesser General Public License 00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>. 00026 00027 */ 00028 00029 #ifndef _CML_noble_varghese_kohl_noble_1998_basic_with_sac_ 00030 #define _CML_noble_varghese_kohl_noble_1998_basic_with_sac_ 00031 00032 #include "ChasteSerialization.hpp" 00033 #include <boost/serialization/base_object.hpp> 00034 00035 #include <cmath> 00036 #include <cassert> 00037 #include "AbstractCardiacCell.hpp" 00038 #include "Exception.hpp" 00039 #include "AbstractStimulusFunction.hpp" 00040 #include "OdeSystemInformation.hpp" 00041 00042 00048 class CML_noble_varghese_kohl_noble_1998_basic_with_sac : public AbstractCardiacCell 00049 { 00050 friend class boost::serialization::access; 00056 template<class Archive> 00057 void serialize(Archive & archive, const unsigned int version) 00058 { 00059 archive & mStretch; 00060 archive & boost::serialization::base_object<AbstractCardiacCell>(*this); 00061 } 00062 private: 00063 00065 double mStretch; 00066 00067 public: 00073 CML_noble_varghese_kohl_noble_1998_basic_with_sac(boost::shared_ptr<AbstractIvpOdeSolver> pSolver, 00074 boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus); 00075 00077 ~CML_noble_varghese_kohl_noble_1998_basic_with_sac(); 00078 00082 double GetIIonic(const std::vector<double>* pStateVariables=NULL); 00083 00090 void EvaluateYDerivatives(double var_environment__time, 00091 const std::vector<double> &rY, 00092 std::vector<double> &rDY); 00093 00098 void SetStretch(double stretch) 00099 { 00100 assert(stretch > 0.0); 00101 mStretch = stretch; 00102 } 00103 00107 double GetStretch() 00108 { 00109 return mStretch; 00110 } 00111 00117 double GetIntracellularCalciumConcentration() 00118 { 00119 return mStateVariables[16]; 00120 } 00121 }; 00122 00123 #include "SerializationExportWrapper.hpp" 00124 CHASTE_CLASS_EXPORT(CML_noble_varghese_kohl_noble_1998_basic_with_sac) 00125 00126 namespace boost 00127 { 00128 namespace serialization 00129 { 00136 template<class Archive> 00137 inline void save_construct_data( 00138 Archive & ar, const CML_noble_varghese_kohl_noble_1998_basic_with_sac * t, const unsigned int fileVersion) 00139 { 00140 const boost::shared_ptr<AbstractIvpOdeSolver> p_solver = t->GetSolver(); 00141 const boost::shared_ptr<AbstractStimulusFunction> p_stimulus = t->GetStimulusFunction(); 00142 ar << p_solver; 00143 ar << p_stimulus; 00144 } 00145 00152 template<class Archive> 00153 inline void load_construct_data( 00154 Archive & ar, CML_noble_varghese_kohl_noble_1998_basic_with_sac * t, const unsigned int fileVersion) 00155 { 00156 boost::shared_ptr<AbstractIvpOdeSolver> p_solver; 00157 boost::shared_ptr<AbstractStimulusFunction> p_stimulus; 00158 ar >> p_solver; 00159 ar >> p_stimulus; 00160 ::new(t)CML_noble_varghese_kohl_noble_1998_basic_with_sac(p_solver, p_stimulus); 00161 } 00162 00163 } 00164 00165 } 00166 00167 #endif