Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Driver.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File Driver.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Base class for Drivers.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef SOLVERUTILS_DRIVER_H
37 #define SOLVERUTILS_DRIVER_H
38 
43 
46 
47 namespace Nektar
48 {
49 namespace SolverUtils
50 {
51 
52 class Driver;
53 
54 /// A shared pointer to a Driver object
55 typedef boost::shared_ptr<Driver> DriverSharedPtr;
56 
57 /// Datatype of the NekFactory used to instantiate classes derived from
58 /// the Driver class.
59 typedef LibUtilities::NekFactory<std::string, Driver,
61 
63 
64 /// Base class for the development of solvers.
65 class Driver
66 {
67 public:
68  /// Destructor
69  virtual ~Driver();
70 
71  /// Initialise Object
72  SOLVER_UTILS_EXPORT inline void InitObject(ostream &out = cout);
73 
74  /// Execute driver
75  SOLVER_UTILS_EXPORT inline void Execute(ostream &out = cout);
76 
77  SOLVER_UTILS_EXPORT inline Array<OneD, EquationSystemSharedPtr> GetEqu();
78 
79  SOLVER_UTILS_EXPORT Array<OneD, NekDouble> GetRealEvl(void);
80  SOLVER_UTILS_EXPORT Array<OneD, NekDouble> GetImagEvl(void);
81 
82 
83 protected:
84  /// Communication object
86 
87  /// Session reader object
89 
90  /// I the Coupling between SFD and arnoldi
92 
93  /// Equation system to solve
94  Array<OneD, EquationSystemSharedPtr> m_equ;
95 
96  ///number of equations
97  int m_nequ;
98 
99  ///Evolution Operator
101 
102  /// Initialises EquationSystem class members.
104 
105  SOLVER_UTILS_EXPORT virtual void v_InitObject(ostream &out = cout);
106 
107  /// Virtual function for solve implementation.
108  SOLVER_UTILS_EXPORT virtual void v_Execute(ostream &out = cout) = 0;
109 
110 
111  SOLVER_UTILS_EXPORT virtual Array<OneD, NekDouble> v_GetRealEvl(void);
112  SOLVER_UTILS_EXPORT virtual Array<OneD, NekDouble> v_GetImagEvl(void);
113 
114 
115  static std::string evolutionOperatorLookupIds[];
116  static std::string evolutionOperatorDef;
117  static std::string driverDefault;
118 
119 };
120 
121 inline void Driver::InitObject(ostream &out)
122 {
123  v_InitObject(out);
124 }
125 
126 inline void Driver::Execute(ostream &out)
127 {
128  v_Execute(out);
129 }
130 
131 inline Array<OneD, EquationSystemSharedPtr> Driver::GetEqu()
132 {
133  return m_equ;
134 }
135 
136 inline Array<OneD, NekDouble> Driver::GetRealEvl()
137 {
138  return v_GetRealEvl();
139 }
140 
141 inline Array<OneD, NekDouble> Driver::GetImagEvl()
142 {
143  return v_GetImagEvl();
144 }
145 
146 }
147 } //end of namespace
148 
149 #endif //NEKTAR_SOLVERS_AUXILIARY_ADRBASE_H
150