BackwardEulerLuoRudyIModel1991.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
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 #ifndef _BACKWARDEULERLUORUDYIMODEL1991_HPP_
00029 #define _BACKWARDEULERLUORUDYIMODEL1991_HPP_
00030 
00031 #include "ChasteSerialization.hpp"
00032 #include <boost/serialization/base_object.hpp>
00033 
00034 #include "AbstractStimulusFunction.hpp"
00035 #include "AbstractBackwardEulerCardiacCell.hpp"
00036 
00037 #include <vector>
00038 
00043 class BackwardEulerLuoRudyIModel1991 : public AbstractBackwardEulerCardiacCell<1>
00044 {
00045 private:
00047     friend class boost::serialization::access;
00054     template<class Archive>
00055     void serialize(Archive & archive, const unsigned int version)
00056     {
00057         // This calls serialize on the base class.
00058         archive & boost::serialization::base_object<AbstractBackwardEulerCardiacCell<1> >(*this);
00059     }
00060     /*
00061      * Constants for the LuoRudyIModel1991OdeSystem model
00062      */
00063     static const double membrane_C; 
00064     static const double membrane_F; 
00065     static const double membrane_R; 
00066     static const double membrane_T; 
00067     static const double background_current_E_b; 
00068     static const double background_current_g_b; 
00069     static const double fast_sodium_current_g_Na; 
00070     static const double ionic_concentrations_Ki; 
00071     static const double ionic_concentrations_Ko; 
00072     static const double ionic_concentrations_Nai; 
00073     static const double ionic_concentrations_Nao; 
00074     static const double plateau_potassium_current_g_Kp; 
00075     static const double time_dependent_potassium_current_PR_NaK; 
00078     double fast_sodium_current_E_Na;
00079 
00080 
00081 public:
00087     BackwardEulerLuoRudyIModel1991(boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00088 
00094     BackwardEulerLuoRudyIModel1991(boost::shared_ptr<AbstractIvpOdeSolver> /* unused */,
00095                                    boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00096 
00100     ~BackwardEulerLuoRudyIModel1991();
00101 
00105     void Init();
00106 
00107 protected:
00114     void ComputeOneStepExceptVoltage(double tStart);
00115 
00121     void UpdateTransmembranePotential(double time);
00122 
00123 public:
00131     void ComputeResidual(double var_environment__time, const double rCurrentGuess[1], double rResidual[1]);
00132 
00140     void ComputeJacobian(double var_environment__time, const double rCurrentGuess[1], double rJacobian[1][1]);
00141 
00146     double GetIIonic();
00147 
00152     void VerifyStateVariables();
00153 
00157     double GetIntracellularCalciumConcentration();
00158 };
00159 
00160 #include "SerializationExportWrapper.hpp"
00161 CHASTE_CLASS_EXPORT(BackwardEulerLuoRudyIModel1991)
00162 
00163 namespace boost
00164 {
00165 namespace serialization
00166 {
00171 template<class Archive>
00172 inline void save_construct_data(
00173     Archive & ar, const BackwardEulerLuoRudyIModel1991 * t, const unsigned int file_version)
00174 {
00175     const boost::shared_ptr<AbstractIvpOdeSolver> p_solver = t->GetSolver();
00176     const boost::shared_ptr<AbstractStimulusFunction> p_stimulus = t->GetStimulusFunction();
00177     ar << p_solver;
00178     ar << p_stimulus;
00179 }
00180 
00187 template<class Archive>
00188 inline void load_construct_data(
00189     Archive & ar, BackwardEulerLuoRudyIModel1991 * t, const unsigned int file_version)
00190 {
00191     boost::shared_ptr<AbstractIvpOdeSolver> p_solver;
00192     boost::shared_ptr<AbstractStimulusFunction> p_stimulus;
00193     ar >> p_solver;
00194     ar >> p_stimulus;
00195     ::new(t)BackwardEulerLuoRudyIModel1991(p_solver, p_stimulus);
00196 }
00197 }
00198 } // namespace ...
00199 
00200 #endif // _BACKWARDEULERLUORUDYIMODEL1991_HPP_

Generated by  doxygen 1.6.2