HeartConfigRelatedCellFactory.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 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 "FoxModel2002BackwardEuler.hpp"
00054 #include "LuoRudy1991.hpp"
00055 #include "LuoRudy1991BackwardEuler.hpp"
00056 #include "FaberRudy2000.hpp"
00057 #include "FaberRudy2000Opt.hpp"
00058 #include "DiFrancescoNoble1985.hpp"
00059 #include "Mahajan2008.hpp"
00060 #include "TenTusscher2006Epi.hpp"
00061 #include "HodgkinHuxley1952.hpp"
00062 #include "Maleckar2008.hpp"
00063 
00064 
00072 template<unsigned SPACE_DIM>
00073 class HeartConfigRelatedCellFactory : public AbstractCardiacCellFactory<SPACE_DIM>
00074 {
00075 private:
00077     cp::ionic_model_selection_type mDefaultIonicModel;
00079     std::vector<ChasteCuboid<SPACE_DIM> > mIonicModelRegions;
00081     std::vector<cp::ionic_model_selection_type> mIonicModelsDefined;
00082 
00084     std::vector<ChasteCuboid<SPACE_DIM> > mStimulatedAreas;
00086     std::vector<boost::shared_ptr<AbstractStimulusFunction> > mStimuliApplied;
00087 
00099     std::vector<AbstractChasteRegion<SPACE_DIM>* > mCellHeterogeneityAreas;
00101     std::vector<double> mScaleFactorGks;
00103     std::vector<double> mScaleFactorIto;
00105     std::vector<double> mScaleFactorGkr;
00106     
00108     std::vector<std::map<std::string, double> > mParameterSettings;
00109 
00116     void PreconvertCellmlFiles();
00117 
00123     DynamicCellModelLoader* LoadDynamicModel(const cp::ionic_model_selection_type& rModel,
00124                                              bool isCollective);
00125 
00126 public:
00132     HeartConfigRelatedCellFactory();
00133 
00135     ~HeartConfigRelatedCellFactory();
00136 
00142     AbstractCardiacCell* CreateCellWithIntracellularStimulus(
00143             boost::shared_ptr<AbstractStimulusFunction> intracellularStimulus,
00144             unsigned nodeIndex);
00145 
00153     AbstractCardiacCell* CreateCardiacCellForTissueNode(unsigned nodeIndex);
00154 
00158     void FillInCellularTransmuralAreas();
00159 
00166     void SetCellParameters(AbstractCardiacCell* pCell, unsigned nodeIndex);
00167     
00174     void SetCellIntracellularStimulus(AbstractCardiacCell* pCell, unsigned nodeIndex);
00175 };
00176 
00177 
00178 #endif /*HEARTCONFIGRELATEDCELLFACTORY_HPP_*/

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