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 00228 virtual AbstractLookupTableCollection* GetLookupTableCollection() 00229 { 00230 return NULL; 00231 } 00232 00236 boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction(); 00237 00244 const boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction() const; 00245 00252 const boost::shared_ptr<AbstractIvpOdeSolver> GetSolver() const; 00253 00258 virtual void SetVoltageDerivativeToZero(bool clamp=true); 00259 00260 protected: 00267 unsigned mVoltageIndex; 00268 00270 boost::shared_ptr<AbstractIvpOdeSolver> mpOdeSolver; 00271 00273 boost::shared_ptr<AbstractStimulusFunction> mpIntracellularStimulus; 00274 00280 bool mSetVoltageDerivativeToZero; 00281 00283 bool mIsUsedInTissue; 00284 00286 bool mHasDefaultStimulusFromCellML; 00287 00288 private: 00290 friend class boost::serialization::access; 00300 template<class Archive> 00301 void serialize(Archive & archive, const unsigned int version) 00302 { 00303 } 00304 }; 00305 00306 CLASS_IS_ABSTRACT(AbstractCardiacCellInterface) 00307 00308 00309 #endif /*ABSTRACTCARDIACCELLINTERFACE_HPP_*/