Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 
62  StimulusFactory& GetStimulusFactory();
63 
64 
65  /// Stimulus base class.
66  class Stimulus
67  {
68  public:
69  virtual ~Stimulus() {}
70 
71  /// Initialise the stimulus storage and set initial conditions
72  void Initialise();
73 
74  /// Updates RHS of outarray by adding a stimulus to it
76  const NekDouble time)
77  {
78  v_Update(outarray, time);
79  }
80 
81  /// Print a summary of the outarray
83  {
85  }
86 
87  static std::vector<StimulusSharedPtr> LoadStimuli(
88  const LibUtilities::SessionReaderSharedPtr& pSession,
89  const MultiRegions::ExpListSharedPtr& pField);
90 
91  protected:
92  /// Session
93  LibUtilities::SessionReaderSharedPtr m_session;
94  /// Transmembrane potential field from PDE system
95  MultiRegions::ExpListSharedPtr m_field;
96  /// Number of physical points.
97  int m_nq;
98  /// Stimulus protocol to apply
100 
101  Stimulus(const LibUtilities::SessionReaderSharedPtr& pSession,
102  const MultiRegions::ExpListSharedPtr& pField,
103  const TiXmlElement* pXml);
104 
105  virtual void v_Update(Array<OneD, Array<OneD, NekDouble> >&outarray,
106  const NekDouble time) = 0;
107 
108  virtual void v_GenerateSummary(SolverUtils::SummaryList& s) = 0;
109 
110  };
111 }
112 
113 #endif
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)=0
boost::shared_ptr< Stimulus > StimulusSharedPtr
A shared pointer to an EquationSystem object.
Definition: Stimulus.h:50
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:47
ProtocolSharedPtr m_Protocol
Stimulus protocol to apply.
Definition: Stimulus.h:99
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: Stimulus.h:93
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
virtual ~Stimulus()
Definition: Stimulus.h:69
boost::shared_ptr< Protocol > ProtocolSharedPtr
A shared pointer to an EquationSystem object.
Definition: Protocol.h:45
int m_nq
Number of physical points.
Definition: Stimulus.h:97
static std::vector< StimulusSharedPtr > LoadStimuli(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField)
Definition: Stimulus.cpp:95
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
LibUtilities::NekFactory< std::string, Stimulus, const LibUtilities::SessionReaderSharedPtr &, const MultiRegions::ExpListSharedPtr &, const TiXmlElement * > StimulusFactory
Datatype of the NekFactory used to instantiate classes derived from the EquationSystem class...
Definition: Stimulus.h:60
Stimulus base class.
Definition: Stimulus.h:66
double NekDouble
Stimulus(const LibUtilities::SessionReaderSharedPtr &pSession, const MultiRegions::ExpListSharedPtr &pField, const TiXmlElement *pXml)
Definition: Stimulus.cpp:67
void Initialise()
Initialise the stimulus storage and set initial conditions.
Definition: Stimulus.cpp:87
void Update(Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Updates RHS of outarray by adding a stimulus to it.
Definition: Stimulus.h:75
MultiRegions::ExpListSharedPtr m_field
Transmembrane potential field from PDE system.
Definition: Stimulus.h:95
StimulusFactory & GetStimulusFactory()
Definition: Stimulus.cpp:45
virtual void v_Update(Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)=0
void GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of the outarray.
Definition: Stimulus.h:82
Provides a generic Factory class.
Definition: NekFactory.hpp:116