LifeV
StimulusSingleSource.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 represented by
29  a current at a single point with a given time and duration
30 
31  @date 02-2014
32  @author Simone Palamara <palamara.simone@gmail.com>
33 
34  @last update 02-2014
35  */
36 
37 #ifndef STIMULUSSINGLESOURCE_HPP_
38 #define STIMULUSSINGLESOURCE_HPP_
39 
40 #include <lifev/electrophysiology/stimulus/ElectroStimulus.hpp>
41 
42 namespace LifeV
43 {
44 
45 class StimulusSingleSource : public ElectroStimulus
46 {
47 
48 public:
49 
50 
51  //! @name Constructors & Destructor
52  //@{
53 
54  //!Empty Constructor
55  /*!
56  */
57  StimulusSingleSource();
58 
59  //! Destructor
60  virtual ~StimulusSingleSource() {}
61 
62  //@}
63 
64  //! @name Set Methods
65  //@{
66 
67  inline void setRadius ( Real r )
68  {
69  ASSERT (r > 0, "Invalid radius value.");
70  M_radius = r;
71  }
72 
73  inline void setTotalCurrent ( Real I )
74  {
75  ASSERT (I >= 0, "Invalid current value.");
76  M_totalCurrent = I;
77  }
78 
79  inline void setPacingSite ( Real x , Real y , Real z )
80  {
81  M_pacingSite_X = x;
82  M_pacingSite_Y = y;
83  M_pacingSite_Z = z;
84  }
85 
86  inline void setStimDuration ( Real duration )
87  {
88  ASSERT (duration > 0, "Invalid stimulus duration value.");
89  M_StimDuration = duration;
90  }
91 
92  inline void setStartingTimeStimulus ( Real startingTimeStimulus )
93  {
94  ASSERT (startingTimeStimulus >= 0, "Invalid starting time stimulus.");
95  M_startingTimeStimulus = startingTimeStimulus;
96  }
97 
98 
99  void setParameters (list_Type& list)
100  {
101  this->setRadius ( list.get ( "applied_current_radius", 0.2 ) );
102  this->setTotalCurrent ( list.get ( "applied_total_current", 1.0 ) );
103  this->setPacingSite (list.get ( "pacing_site_X", 1.0 ), list.get ( "pacing_site_Y", 1.0 ), list.get ( "pacing_site_Z", 1.0 ) );
104  this->setStimDuration ( list.get ( "duration_stimulus", 1.0 ) );
105  this->setStartingTimeStimulus ( list.get ("starting_time_stimulus", 0.0 ) );
106  }
107 
108 
109  //@}
110 
111  //! @name Copy Methods
112  //@{
113 
114  //@}
115 
116  //! @name Methods
117  //@{
118  Real appliedCurrent ( const Real& t, const Real& x, const Real& y, const Real& z, const ID& i );
119 
120  void showMe ();
121  //@}
122 
123 private:
124 
125  Real M_radius;
126  Real M_totalCurrent;
127  Real M_pacingSite_X;
128  Real M_pacingSite_Y;
129  Real M_pacingSite_Z;
130  Real M_startingTimeStimulus;
131  Real M_StimDuration;
132 };
133 
134 } // namespace LifeV
135 
136 #endif /* STIMULUSSINGLESOURCE_HPP_ */
#define ASSERT(X, A)
Definition: LifeAssert.hpp:90