LifeV
StimulusPMJ.hpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3  *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23  *******************************************************************************
24  */
25 //@HEADER
26 /*!
27  @file
28  @brief Class for applying cardiac stimulus at Purkinje-muscle junctions
29 
30  @date 11-2013
31  @author Toni Lassila <toni.lassila@epfl.ch>
32 
33  @last update 11-2013
34  */
35 
36 #ifndef STIMULUSPMJ_HPP_
37 #define STIMULUSPMJ_HPP_
38 
39 #include <lifev/electrophysiology/stimulus/ElectroStimulus.hpp>
40 
41 namespace LifeV
42 {
43 
44 class StimulusPMJ : public ElectroStimulus
45 {
46 
47 public:
48 
49  //! @name Type definitions
50  //@{
51 
52  /*! @struct StimulusPMJ_Activation
53  */
54  struct StimulusPMJ_Activation
55  {
56  Real x;
57  Real y;
58  Real z;
59  Real time;
60  Real duration;
61  };
62 
63  typedef std::vector<StimulusPMJ_Activation > activationData_type;
64 
65  //@}
66 
67  //! @name Constructors & Destructor
68  //@{
69 
70  //!Empty Constructor
71  /*!
72  */
73  StimulusPMJ();
74 
75  //! Destructor
76  virtual ~StimulusPMJ() {}
77 
78  //@}
79 
80  //! @name Get Methods
81  //@{
82  inline activationData_type activationData( )
83  {
84  return M_activationData;
85  }
86 
87  //@}
88 
89  //! @name Set Methods
90  //@{
91  void setPMJFromFile ( std::string fileName );
92  void setPMJAddJunction ( Real x, Real y, Real z, Real time, Real duration );
93  inline void setProblemFolder ( std::string problemFolder )
94  {
95  M_problemFolder = problemFolder;
96  }
97 
98  inline void setRadius ( Real r )
99  {
100  ASSERT (r > 0, "Invalid radius value.");
101  M_radius = r;
102  }
103 
104  inline void setTotalCurrent ( Real I )
105  {
106  ASSERT (I >= 0, "Invalid current value.");
107  M_totalCurrent = I;
108  }
109 
110  void setParameters (list_Type& list)
111  {
112  this->setRadius ( list.get ("applied_current_radius", 0.2) );
113  this->setTotalCurrent ( list.get ("applied_total_current", 1.0) );
114  this->setProblemFolder ( list.get ("PMJ_activation_folder", "./") );
115  this->setPMJFromFile ( M_problemFolder + list.get ("PMJ_activation_file", "PMJ_activation.txt") );
116  }
117 
118  //@}
119 
120  //! @name Copy Methods
121  //@{
122 
123  //@}
124 
125  //! @name Methods
126  //@{
127  Real appliedCurrent ( const Real& t, const Real& x, const Real& y, const Real& z, const ID& i );
128  void showMe ();
129  //@}
130 
131 private:
132 
133  activationData_type M_activationData;
134  Real M_radius;
135  Real M_totalCurrent;
136  std::string M_problemFolder;
137 
138 };
139 
140 } // namespace LifeV
141 
142 #endif /* STIMULUSPMJ_HPP_ */
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90