Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Stimulus.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File Stimulus.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 //
10 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
11 // Department of Aeronautics, Imperial College London (UK), and Scientific
12 // Computing and Imaging Institute, University of Utah (USA).
13 //
14 // License for the specific language governing rights and limitations under
15 // Permission is hereby granted, free of charge, to any person obtaining a
16 // copy of this software and associated documentation files (the "Software"),
17 // to deal in the Software without restriction, including without limitation
18 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
19 // and/or sell copies of the Software, and to permit persons to whom the
20 // Software is furnished to do so, subject to the following conditions:
21 //
22 // The above copyright notice and this permission notice shall be included
23 // in all copies or substantial portions of the Software.
24 //
25 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
26 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
31 // DEALINGS IN THE SOFTWARE.
32 //
33 // Description: Stimulus base class header.
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_SOLVERS_CARDIACEPSOLVER_STIMULI_STIMULUS
38 #define NEKTAR_SOLVERS_CARDIACEPSOLVER_STIMULI_STIMULUS
39 
43 #include <MultiRegions/ExpList.h>
45 #include <SolverUtils/Core/Misc.h>
46 
47 namespace Nektar
48 {
49  // Forward declaration
50  class Stimulus;
51 
52  /// A shared pointer to an EquationSystem object
53  typedef boost::shared_ptr<Stimulus> StimulusSharedPtr;
54 
55  /// Datatype of the NekFactory used to instantiate classes derived from
56  /// the EquationSystem class.
57  typedef LibUtilities::NekFactory< std::string, Stimulus,
60  const TiXmlElement*> StimulusFactory;
61 
63 
64 
65  /// Stimulus base class.
66  class Stimulus
67  {
68  public:
70  const MultiRegions::ExpListSharedPtr& pField,
71  const TiXmlElement* pXml);
72 
73  virtual ~Stimulus() {}
74 
75  /// Initialise the stimulus storage and set initial conditions
76  void Initialise();
77 
78  /// Updates RHS of outarray by adding a stimulus to it
79  void Update(Array<OneD, Array<OneD, NekDouble> >&outarray,
80  const NekDouble time)
81  {
82  v_Update(outarray, time);
83  }
84 
85  /// Print a summary of the outarray
87  {
89  }
90 
91  static std::vector<StimulusSharedPtr> LoadStimuli(
93  const MultiRegions::ExpListSharedPtr& pField);
94 
95  protected:
96  /// Session
98  /// Transmembrane potential field from PDE system
100  /// Number of physical points.
101  int m_nq;
103 
104  virtual void v_Update(Array<OneD, Array<OneD, NekDouble> >&outarray,
105  const NekDouble time) = 0;
106 
107  virtual void v_GenerateSummary(SolverUtils::SummaryList& s) = 0;
108 
109  };
110 }
111 
112 #endif