AbstractCardiacCellInterface.hpp

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 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 #include "AbstractLookupTableCollection.hpp"
00041 
00054 class AbstractCardiacCellInterface
00055 {
00056 public:
00069     AbstractCardiacCellInterface(boost::shared_ptr<AbstractIvpOdeSolver> pOdeSolver,
00070                                  unsigned voltageIndex,
00071                                  boost::shared_ptr<AbstractStimulusFunction> pIntracellularStimulus);
00072 
00074     virtual ~AbstractCardiacCellInterface();
00075 
00081     virtual void SetTimestep(double dt)=0;
00082 
00091     virtual void SolveAndUpdateState(double tStart, double tEnd)=0;
00092 
00102     virtual OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0)=0;
00103 
00112     virtual void ComputeExceptVoltage(double tStart, double tEnd)=0;
00113 
00139     virtual double GetIIonic(const std::vector<double>* pStateVariables=NULL)=0;
00140 
00144     virtual void SetVoltage(double voltage)=0;
00145 
00150     virtual double GetVoltage()=0;
00151 
00158     unsigned GetVoltageIndex();
00159 
00165     void SetStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00166 
00172     double GetStimulus(double time);
00173 
00180     void SetIntracellularStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus);
00181 
00189     double GetIntracellularStimulus(double time);
00190 
00197     double GetIntracellularAreaStimulus(double time);
00198 
00207     void SetUsedInTissueSimulation(bool tissue=true);
00208 
00215     virtual void UseCellMLDefaultStimulus();
00216 
00220     bool HasCellMLDefaultStimulus();
00221 
00229     virtual void VerifyStateVariables()
00230     {
00231         // See also #794.
00232     }
00233 
00240     virtual AbstractLookupTableCollection* GetLookupTableCollection()
00241     {
00242         return NULL;
00243     }
00244 
00248     boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction();
00249 
00256     const boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction() const;
00257 
00264     const boost::shared_ptr<AbstractIvpOdeSolver> GetSolver() const;
00265 
00266 protected:
00273     unsigned mVoltageIndex;
00274 
00276     boost::shared_ptr<AbstractIvpOdeSolver> mpOdeSolver;
00277 
00279     boost::shared_ptr<AbstractStimulusFunction> mpIntracellularStimulus;
00280 
00286     bool mSetVoltageDerivativeToZero;
00287 
00289     bool mIsUsedInTissue;
00290 
00292     bool mHasDefaultStimulusFromCellML;
00293 
00294 private:
00296     friend class boost::serialization::access;
00306     template<class Archive>
00307     void serialize(Archive & archive, const unsigned int version)
00308     {
00309     }
00310 };
00311 
00312 CLASS_IS_ABSTRACT(AbstractCardiacCellInterface)
00313 
00314 
00315 #endif /*ABSTRACTCARDIACCELLINTERFACE_HPP_*/

Generated on Tue May 31 14:31:41 2011 for Chaste by  doxygen 1.5.5