Chaste  Release::3.4
HeartConfigRelatedCellFactory.hpp
1 /*
2 
3 Copyright (c) 2005-2016, University of Oxford.
4 All rights reserved.
5 
6 University of Oxford means the Chancellor, Masters and Scholars of the
7 University of Oxford, having an administrative office at Wellington
8 Square, Oxford OX1 2JD, UK.
9 
10 This file is part of Chaste.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #ifndef HEARTCONFIGRELATEDCELLFACTORY_HPP_
37 #define HEARTCONFIGRELATEDCELLFACTORY_HPP_
38 
39 #include <vector>
40 #include <map>
41 #include <boost/shared_ptr.hpp>
42 
43 #include "AbstractCardiacCellFactory.hpp"
44 #include "HeartConfig.hpp"
45 
46 #include "AbstractStimulusFunction.hpp"
47 #include "MultiStimulus.hpp" // Included here for archiving - see below.
48 #include "SimpleStimulus.hpp"
49 
50 #include "ChasteCuboid.hpp"
51 #include "AbstractChasteRegion.hpp"
52 
53 #include "DynamicCellModelLoader.hpp"
54 
55 /*
56  * Even though these classes are only used in the .cpp file, they need to be
57  * included here for serialization to work - the archiving code needs to see
58  * the CHASTE_CLASS_EXPORT incantations.
59  */
60 #include "DiFrancescoNoble1985.hpp"
61 #include "FaberRudy2000.hpp"
62 #include "FaberRudy2000Opt.hpp"
63 #include "FoxModel2002.hpp"
64 #include "FoxModel2002BackwardEuler.hpp"
65 #include "HodgkinHuxley1952.hpp"
66 #include "LuoRudy1991.hpp"
67 #include "LuoRudy1991BackwardEuler.hpp"
68 #include "Mahajan2008.hpp"
69 #include "Mahajan2008BackwardEuler.hpp"
70 #include "Maleckar2008.hpp"
71 #include "TenTusscher2006Epi.hpp"
72 #include "TenTusscher2006EpiBackwardEuler.hpp"
73 
74 /*
75  * The following cell models aren't used by this class, but do exist in Chaste.
76  * So users of the source code could see issues with archiving if they aren't included.
77  */
78 #include "FoxModel2002Opt.hpp"
79 #include "LuoRudy1991Opt.hpp"
80 #include "Mahajan2008Opt.hpp"
81 #include "Maleckar2008Opt.hpp"
82 #include "NobleVargheseKohlNoble1998a.hpp"
83 #include "NobleVargheseKohlNoble1998aOpt.hpp"
84 #include "NobleVargheseKohlNoble1998aBackwardEuler.hpp"
85 #include "Shannon2004.hpp"
86 #include "TenTusscher2006EpiOpt.hpp"
87 
95 template<unsigned SPACE_DIM>
97 {
98 private:
100  cp::ionic_model_selection_type mDefaultIonicModel;
102  std::vector<boost::shared_ptr<AbstractChasteRegion<SPACE_DIM> > > mIonicModelRegions;
104  std::vector<cp::ionic_model_selection_type> mIonicModelsDefined;
105 
107  std::vector<boost::shared_ptr<AbstractChasteRegion<SPACE_DIM> > > mStimulatedAreas;
109  std::vector<boost::shared_ptr<AbstractStimulusFunction> > mStimuliApplied;
110 
122  std::vector<boost::shared_ptr<AbstractChasteRegion<SPACE_DIM> > > mCellHeterogeneityAreas;
124  std::vector<double> mScaleFactorGks;
126  std::vector<double> mScaleFactorIto;
128  std::vector<double> mScaleFactorGkr;
129 
131  std::vector<std::map<std::string, double> > mParameterSettings;
132 
139  void PreconvertCellmlFiles();
140 
146  DynamicCellModelLoaderPtr LoadDynamicModel(const cp::ionic_model_selection_type& rModel,
147  bool isCollective);
148 
149 public:
156 
159 
166  boost::shared_ptr<AbstractStimulusFunction> intracellularStimulus,
167  unsigned nodeIndex);
168 
177 
182 
189  void SetCellParameters(AbstractCardiacCellInterface* pCell, unsigned nodeIndex);
190 
197  void SetCellIntracellularStimulus(AbstractCardiacCellInterface* pCell, unsigned nodeIndex);
198 };
199 
200 
201 #endif /*HEARTCONFIGRELATEDCELLFACTORY_HPP_*/
Definition: Node.hpp:58
DynamicCellModelLoaderPtr LoadDynamicModel(const cp::ionic_model_selection_type &rModel, bool isCollective)
std::vector< boost::shared_ptr< AbstractChasteRegion< SPACE_DIM > > > mCellHeterogeneityAreas
std::vector< boost::shared_ptr< AbstractStimulusFunction > > mStimuliApplied
AbstractCardiacCellInterface * CreateCellWithIntracellularStimulus(boost::shared_ptr< AbstractStimulusFunction > intracellularStimulus, unsigned nodeIndex)
std::vector< boost::shared_ptr< AbstractChasteRegion< SPACE_DIM > > > mStimulatedAreas
std::vector< std::map< std::string, double > > mParameterSettings
AbstractCardiacCellInterface * CreateCardiacCellForTissueNode(Node< SPACE_DIM > *pNode)
std::vector< boost::shared_ptr< AbstractChasteRegion< SPACE_DIM > > > mIonicModelRegions
void SetCellIntracellularStimulus(AbstractCardiacCellInterface *pCell, unsigned nodeIndex)
std::vector< cp::ionic_model_selection_type > mIonicModelsDefined
cp::ionic_model_selection_type mDefaultIonicModel
void SetCellParameters(AbstractCardiacCellInterface *pCell, unsigned nodeIndex)