HeartConfigRelatedCellFactory.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 HEARTCONFIGRELATEDCELLFACTORY_HPP_
00030 #define HEARTCONFIGRELATEDCELLFACTORY_HPP_
00031 
00032 #include <vector>
00033 #include <map>
00034 #include <boost/shared_ptr.hpp>
00035 
00036 #include "AbstractCardiacCellFactory.hpp"
00037 #include "HeartConfig.hpp"
00038 
00039 #include "AbstractStimulusFunction.hpp"
00040 #include "MultiStimulus.hpp" // Included here for archiving - see below.
00041 #include "SimpleStimulus.hpp"
00042 
00043 #include "ChasteCuboid.hpp"
00044 #include "AbstractChasteRegion.hpp"
00045 
00046 #include "DynamicCellModelLoader.hpp"
00047 
00048 /*
00049  * Even though these classes are only used in the .cpp file, they need to be
00050  * included here for serialization to work - the archiving code needs to see
00051  * the CHASTE_CLASS_EXPORT incantations.
00052  */
00053 #include "DiFrancescoNoble1985.hpp"
00054 #include "FaberRudy2000.hpp"
00055 #include "FaberRudy2000Opt.hpp"
00056 #include "FoxModel2002BackwardEuler.hpp"
00057 #include "HodgkinHuxley1952.hpp"
00058 #include "LuoRudy1991.hpp"
00059 #include "LuoRudy1991BackwardEuler.hpp"
00060 #include "Mahajan2008.hpp"
00061 #include "Maleckar2008.hpp"
00062 #include "TenTusscher2006Epi.hpp"
00063 
00064 /*
00065  * The following cell models aren't used by this class, but do exist in Chaste.
00066  * So users of the source code could see issues with archiving if they aren't included.
00067  */
00068 #include "FoxModel2002.hpp"
00069 #include "FoxModel2002Opt.hpp"
00070 #include "LuoRudy1991Opt.hpp"
00071 #include "Mahajan2008Opt.hpp"
00072 #include "Mahajan2008BackwardEuler.hpp"
00073 #include "Maleckar2008Opt.hpp"
00074 #include "NobleVargheseKohlNoble1998a.hpp"
00075 #include "NobleVargheseKohlNoble1998aOpt.hpp"
00076 #include "NobleVargheseKohlNoble1998aBackwardEuler.hpp"
00077 #include "Shannon2004.hpp"
00078 #include "TenTusscher2006EpiOpt.hpp"
00079 #include "TenTusscher2006EpiBackwardEuler.hpp"
00080 
00088 template<unsigned SPACE_DIM>
00089 class HeartConfigRelatedCellFactory : public AbstractCardiacCellFactory<SPACE_DIM>
00090 {
00091 private:
00093     cp::ionic_model_selection_type mDefaultIonicModel;
00095     std::vector<boost::shared_ptr<AbstractChasteRegion<SPACE_DIM> > > mIonicModelRegions;
00097     std::vector<cp::ionic_model_selection_type> mIonicModelsDefined;
00098 
00100     std::vector<boost::shared_ptr<AbstractChasteRegion<SPACE_DIM> > > mStimulatedAreas;
00102     std::vector<boost::shared_ptr<AbstractStimulusFunction> > mStimuliApplied;
00103 
00115     std::vector<boost::shared_ptr<AbstractChasteRegion<SPACE_DIM> > > mCellHeterogeneityAreas;
00117     std::vector<double> mScaleFactorGks;
00119     std::vector<double> mScaleFactorIto;
00121     std::vector<double> mScaleFactorGkr;
00122 
00124     std::vector<std::map<std::string, double> > mParameterSettings;
00125 
00132     void PreconvertCellmlFiles();
00133 
00139     DynamicCellModelLoader* LoadDynamicModel(const cp::ionic_model_selection_type& rModel,
00140                                              bool isCollective);
00141 
00142 public:
00148     HeartConfigRelatedCellFactory();
00149 
00151     ~HeartConfigRelatedCellFactory();
00152 
00158     AbstractCardiacCell* CreateCellWithIntracellularStimulus(
00159             boost::shared_ptr<AbstractStimulusFunction> intracellularStimulus,
00160             unsigned nodeIndex);
00161 
00169     AbstractCardiacCell* CreateCardiacCellForTissueNode(unsigned nodeIndex);
00170 
00174     void FillInCellularTransmuralAreas();
00175 
00182     void SetCellParameters(AbstractCardiacCell* pCell, unsigned nodeIndex);
00183 
00190     void SetCellIntracellularStimulus(AbstractCardiacCell* pCell, unsigned nodeIndex);
00191 };
00192 
00193 
00194 #endif /*HEARTCONFIGRELATEDCELLFACTORY_HPP_*/
Generated on Thu Dec 22 13:00:06 2011 for Chaste by  doxygen 1.6.3