AbstractCardiacCellInterface.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 
00029 #ifndef ABSTRACTCARDIACCELLINTERFACE_HPP_
00030 #define ABSTRACTCARDIACCELLINTERFACE_HPP_
00031 
00032 #include <boost/shared_ptr.hpp>
00033 
00034 #include "ChasteSerialization.hpp"
00035 #include "ClassIsAbstract.hpp"
00036 
00037 #include "AbstractIvpOdeSolver.hpp"
00038 #include "AbstractStimulusFunction.hpp"
00039 #include "OdeSolution.hpp"
00040 
00053 class AbstractCardiacCellInterface
00054 {
00055 public:
00068     AbstractCardiacCellInterface(boost::shared_ptr<AbstractIvpOdeSolver> pOdeSolver,
00069                                  unsigned voltageIndex,
00070                                  boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00071 
00073     virtual ~AbstractCardiacCellInterface();
00074     
00078     virtual void ResetToInitialConditions()=0;
00079     
00089     virtual OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0)=0;
00090 
00099     virtual void ComputeExceptVoltage(double tStart, double tEnd)=0;
00100 
00123     virtual double GetIIonic()=0;
00124 
00128     virtual void SetVoltage(double voltage)=0;
00129 
00134     virtual double GetVoltage()=0;
00135 
00137     unsigned GetVoltageIndex();
00138 
00144     void SetStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00145 
00151     double GetStimulus(double time);
00152 
00159     void SetIntracellularStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00160 
00168     double GetIntracellularStimulus(double time);
00169 
00176     double GetIntracellularAreaStimulus(double time);
00177 
00186     void SetUsedInTissueSimulation(bool tissue=true);
00187 
00194     virtual void UseCellMLDefaultStimulus();
00195     
00199     bool HasCellMLDefaultStimulus();
00200 
00207     virtual void VerifyStateVariables()
00208     {
00209         // See also #794.
00210     }
00211     
00215     boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction();
00216     
00223     const boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction() const;
00224 
00231     const boost::shared_ptr<AbstractIvpOdeSolver> GetSolver() const;
00232     
00233 protected:
00235     unsigned mVoltageIndex;
00236 
00238     boost::shared_ptr<AbstractIvpOdeSolver> mpOdeSolver;
00239 
00241     boost::shared_ptr<AbstractStimulusFunction> mpIntracellularStimulus;
00242 
00248     bool mSetVoltageDerivativeToZero;
00249 
00251     bool mIsUsedInTissue;
00252 
00254     bool mHasDefaultStimulusFromCellML;
00255 
00256 private:
00258     friend class boost::serialization::access;
00268     template<class Archive>
00269     void serialize(Archive & archive, const unsigned int version)
00270     {
00271     }
00272 };
00273 
00274 CLASS_IS_ABSTRACT(AbstractCardiacCellInterface)
00275 
00276 
00277 #endif /*ABSTRACTCARDIACCELLINTERFACE_HPP_*/

Generated on Mon Nov 1 12:35:16 2010 for Chaste by  doxygen 1.5.5