LifeV
StimulusPacingProtocol.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 a single point according to a pacing protocol
29 
30  @date 02-2014
31  @author Simone Palamara <palamara.simone@gmail.com>
32 
33  @last update 02-2014
34  */
35 
36 #ifndef STIMULUSPACINGPROTOCOL_HPP_
37 #define STIMULUSPACINGPROTOCOL_HPP_
38 
39 #include <lifev/electrophysiology/stimulus/ElectroStimulus.hpp>
40 
41 namespace LifeV
42 {
43 
44 class StimulusPacingProtocol : public ElectroStimulus
45 {
46 
47 public:
48 
49  //! @name Constructors & Destructor
50  //@{
51 
52  //!Empty Constructor
53  /*!
54  */
56 
57  //! Destructor
58  virtual ~StimulusPacingProtocol() {}
59 
60  //@}
61 
62  //! @name Set Methods
63  //@{
64 
65  inline void setRadius ( Real r )
66  {
67  ASSERT (r > 0, "Invalid radius value.");
68  M_radius = r;
69  }
70 
71  inline void setStimulusAmplitude ( Real I )
72  {
73  ASSERT (I >= 0, "Invalid current value.");
75  }
76 
77  inline void setPacingSite ( Real x , Real y , Real z )
78  {
79  M_pacingSite_X = x;
80  M_pacingSite_Y = y;
81  M_pacingSite_Z = z;
82  }
83 
84  inline void setPacingProtocol ( std::string PacingProtocol )
85  {
86  M_pacingProtocol = PacingProtocol;
87  }
88 
89 
90  inline const Real& StInt() const
91  {
92  return M_stimulusInterval;
93  }
94  inline void setStInt (const Real& StInt)
95  {
96  this->M_stimulusInterval = StInt;
97  }
98 
99  inline const Real& timeShortS1S1() const
100  {
101  return M_tShortS1S1;
102  }
103  inline void setTimeShortS1S1 (const Real& tShortS1S1)
104  {
105  this->M_tShortS1S1 = tShortS1S1;
106  }
107 
108  inline const Real& startingTimeStimulus() const
109  {
110  return M_startingTimeStimulus;
111  }
112  inline void setStartingTimeStimulus (const Real& startingTimeStimulus)
113  {
114  this->M_startingTimeStimulus = startingTimeStimulus;
115  }
116 
117  inline const Real& stIntMin() const
118  {
120  }
121  inline void setStIntMin (const Real& stIntMin)
122  {
123  this->M_minimumStimulusInterval = stIntMin;
124  }
125 
126  inline const Real& timeStep() const
127  {
128  return M_dt;
129  }
130  inline void setTimeStep (const Real& dt)
131  {
132  this->M_dt = dt;
133  }
134 
135 
136  inline const Real& stIntS1S2() const
137  {
138  return M_stIntS1S2;
139  }
140  inline void setStIntS1S2 (const Real& stIntS1S2 )
141  {
142  this->M_stIntS1S2 = stIntS1S2;
143  }
144 
145  inline const Real& stIntS1S2Min() const
146  {
147  return M_stIntS1S2Min;
148  }
149  inline void setStIntS1S2Min (const Real& stIntS1S2Min )
150  {
151  this->M_stIntS1S2Min = stIntS1S2Min;
152  }
153 
154  inline const Real& stIntS2S3() const
155  {
156  return M_stIntS2S3;
157  }
158  inline void setStIntS2S3 (const Real& stIntS2S3)
159  {
160  this->M_stIntS2S3 = stIntS2S3;
161  }
162 
163  inline const Real& stIntS3S4() const
164  {
165  return M_stIntS3S4;
166  }
167  inline void setStIntS3S4 (const Real& stIntS3S4)
168  {
169  this->M_stIntS3S4 = stIntS3S4;
170  }
171 
172  inline const int& nbStimMax() const
173  {
174  return M_nbStimMax;
175  }
176  inline void setNbStimMax (const int& nbStimMax)
177  {
178  this->M_nbStimMax = nbStimMax;
179  }
180 
181  inline const int& repeatSt() const
182  {
183  return M_repeatSt;
184  }
185  inline void setRepeatSt (const int& repeatSt)
186  {
187  this->M_repeatSt = repeatSt;
188  }
189 
190  inline const Real& stimulusDuration() const
191  {
192  return M_stimulusDuration;
193  }
194  inline void setStimulusDuration (const Real& stimDur)
195  {
196  this->M_stimulusDuration = stimDur;
197  }
198 
199  inline void setPacingProtocolType (const std::string& pacProTyp)
200  {
201  this->M_pacingProtocolType = pacProTyp;
202  }
203 
204 
205  void setParameters (list_Type& list)
206  {
207  M_startingTimeStimulus = list.get ("starting_time_stimulus", 0.0);
208  M_tShortS1S1 = list.get ("tShortS1S1", 0.001);
209  M_stimulusInterval = list.get ("stimulus_interval", 0.0 );
210  this->setStIntMin ( list.get ("stIntMin", 0.001) );
211  this->setStIntS1S2 ( list.get ("stIntS1S2", 0.0) );
212  this->setStIntS1S2Min ( list.get ("stIntS1S2Min", 10.0) );
213  this->setStIntS2S3 ( list.get ("stIntS2S3", 0.01) );
214  this->setStIntS3S4 ( list.get ("stIntS3S4", 0.01) );
215  M_nbStimMax = list.get ("nbStimMax", 1);
216  this->setRepeatSt ( list.get ("repeatSt", 1) );
217  this->setTimeStep ( list.get ("dt", 0.01) );
218  this->setPacingProtocol ( list.get ("pacPro", "FCL-ExtraSt") );
219  this->setPacingProtocolType ( list.get ("pacProType", "S1-S2") );
220  M_stimulusDuration = list.get ("duration_stimulus", 1.0 );
221  M_pacingSite_X = list.get ( "pacing_site_X", 1.0 );
222  M_pacingSite_Y = list.get ( "pacing_site_Y", 1.0 );
223  M_pacingSite_Z = list.get ( "pacing_site_Z", 1.0 );
224  M_radius = list.get ( "applied_current_radius", 0.2 );
225  M_stimulusAmplitude = list.get ( "stimulus_amplitude", 1.0 );
226  }
227 
228 
229  //@}
230 
231  //! @name Copy Methods
232  //@{
233 
234  //@}
235 
236  //! @name Methods
237  //@{
238  Real appliedCurrent ( const Real& t, const Real& x, const Real& y, const Real& z, const ID& i );
239 
240 
241  // Stimulation at constant frequency
242  Real fixedCycleLength ( const Real& t );
243 
244  // Stimulation at constant frequency with extra stimulation ( respective Si-Sj interval = constant )
245  Real fixedCycleLengthwExtraStim ( const Real& t );
246 
247  // Standard stimulation protocol
248  Real standardS1S2Protocol ( const Real& t );
249 
250  // Dynamic stimulation protocol
251  Real dynamicProtocol ( const Real& t );
252 
253  Real pacingProtocolChoice ( const Real& t );
254 
255 
256  void showMe();
257 
258  //@}
259 
260 private:
261 
267 
268  // Values of the stimulation interval used in the protocols.
271  Real M_stimulusInterval; //Duration of the time interval between two stimuli
272  Real M_minimumStimulusInterval; //Minimum duration of the time interval between two stimuli in a dynamic pacing protocol
277 
278  // Number of stimulation information
279  int M_nbStimMax; //Number of stimuli that we want to apply // infinity = -1
282 
283  // Choice of the protocol
284  std::string M_pacingProtocol;
285  std::string M_pacingProtocolType;
286 
287  // Value of the current stimulation
289 
290  //Discretization time step used to understand when a stimulus in
291  //the pacing train
293 
294 
295 
296 };
297 
298 } // namespace LifeV
299 
300 #endif /* STIMULUSPACINGPROTOCOL_HPP_ */
void setPacingSite(Real x, Real y, Real z)
void setStartingTimeStimulus(const Real &startingTimeStimulus)
Real fixedCycleLengthwExtraStim(const Real &t)
void setNbStimMax(const int &nbStimMax)
void setStIntMin(const Real &stIntMin)
void updateInverseJacobian(const UInt &iQuadPt)
virtual ~StimulusPacingProtocol()
Destructor.
void setStIntS1S2Min(const Real &stIntS1S2Min)
void setPacingProtocol(std::string PacingProtocol)
Real pacingProtocolChoice(const Real &t)
Methods.
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90
uint32_type ID
IDs.
Definition: LifeV.hpp:194
Real appliedCurrent(const Real &t, const Real &x, const Real &y, const Real &z, const ID &i)
void setRepeatSt(const int &repeatSt)
void setStIntS2S3(const Real &stIntS2S3)
void setStIntS1S2(const Real &stIntS1S2)
double Real
Generic real data.
Definition: LifeV.hpp:175
void setStIntS3S4(const Real &stIntS3S4)
void setStimulusDuration(const Real &stimDur)
void setTimeShortS1S1(const Real &tShortS1S1)
StimulusPacingProtocol()
Empty Constructor.
void setPacingProtocolType(const std::string &pacProTyp)