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 00079 virtual void ResetToInitialConditions()=0; 00080 00086 virtual void SetTimestep(double dt)=0; 00087 00096 virtual void SolveAndUpdateState(double tStart, double tEnd)=0; 00097 00107 virtual OdeSolution Compute(double tStart, double tEnd, double tSamp=0.0)=0; 00108 00117 virtual void ComputeExceptVoltage(double tStart, double tEnd)=0; 00118 00144 virtual double GetIIonic(const std::vector<double>* pStateVariables=NULL)=0; 00145 00149 virtual void SetVoltage(double voltage)=0; 00150 00155 virtual double GetVoltage()=0; 00156 00163 unsigned GetVoltageIndex(); 00164 00170 void SetStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus); 00171 00177 double GetStimulus(double time); 00178 00185 void SetIntracellularStimulusFunction(boost::shared_ptr<AbstractStimulusFunction> pStimulus); 00186 00194 double GetIntracellularStimulus(double time); 00195 00202 double GetIntracellularAreaStimulus(double time); 00203 00212 void SetUsedInTissueSimulation(bool tissue=true); 00213 00220 virtual void UseCellMLDefaultStimulus(); 00221 00225 bool HasCellMLDefaultStimulus(); 00226 00234 virtual void VerifyStateVariables() 00235 { 00236 // See also #794. 00237 } 00238 00245 virtual AbstractLookupTableCollection* GetLookupTableCollection() 00246 { 00247 return NULL; 00248 } 00249 00253 boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction(); 00254 00261 const boost::shared_ptr<AbstractStimulusFunction> GetStimulusFunction() const; 00262 00269 const boost::shared_ptr<AbstractIvpOdeSolver> GetSolver() const; 00270 00271 protected: 00278 unsigned mVoltageIndex; 00279 00281 boost::shared_ptr<AbstractIvpOdeSolver> mpOdeSolver; 00282 00284 boost::shared_ptr<AbstractStimulusFunction> mpIntracellularStimulus; 00285 00291 bool mSetVoltageDerivativeToZero; 00292 00294 bool mIsUsedInTissue; 00295 00297 bool mHasDefaultStimulusFromCellML; 00298 00299 private: 00301 friend class boost::serialization::access; 00311 template<class Archive> 00312 void serialize(Archive & archive, const unsigned int version) 00313 { 00314 } 00315 }; 00316 00317 CLASS_IS_ABSTRACT(AbstractCardiacCellInterface) 00318 00319 00320 #endif /*ABSTRACTCARDIACCELLINTERFACE_HPP_*/