Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DriverSteadyState.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File AdvectionTerm.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: Driver class for the stability solver
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERUTILS_DRIVERSTEADYSTATE_H
37 #define NEKTAR_SOLVERUTILS_DRIVERSTEADYSTATE_H
38 
39 #include <SolverUtils/Driver.h>
40 
41 namespace Nektar
42 {
43  namespace SolverUtils
44  {
45  /// Base class for the development of solvers.
46  class DriverSteadyState: public Driver
47  {
48  public:
50 
51  /// Creates an instance of this class
54  p->InitObject();
55  return p;
56  }
57 
58  ///Name of the class
59  static std::string className;
60 
61  void ConvergenceHistory(const Array<OneD, const Array<OneD, NekDouble> > &qBar1,
62  const Array<OneD, const Array<OneD, NekDouble> > &q0,
65 
66  void EvaluateNextSFDVariables(const int i,
67  const Array<OneD, const Array<OneD, NekDouble> > &q0,
68  const Array<OneD, const Array<OneD, NekDouble> > &qBar0,
69  Array<OneD, Array<OneD, NekDouble> > &q1,
70  Array<OneD, Array<OneD, NekDouble> > &qBar1);
71 
72  void RunBDF2(const int i,
73  const Array<OneD, const Array<OneD, NekDouble> > &qMinus1,
74  const Array<OneD, const Array<OneD, NekDouble> > &qBarMinus1,
75  const Array<OneD, const Array<OneD, NekDouble> > &q0,
76  const Array<OneD, const Array<OneD, NekDouble> > &qBar0,
77  Array<OneD, Array<OneD, NekDouble> > &q1,
78  Array<OneD, Array<OneD, NekDouble> > &qBar1);
79 
80  void RunBDF1(const int i,
81  const Array<OneD, const Array<OneD, NekDouble> > &q0,
82  const Array<OneD, const Array<OneD, NekDouble> > &qBar0,
83  Array<OneD, Array<OneD, NekDouble> > &q1,
84  Array<OneD, Array<OneD, NekDouble> > &qBar1);
85 
86  void ExactFilters(const int i,
87  const Array<OneD, const Array<OneD, NekDouble> > &q0,
88  const Array<OneD, const Array<OneD, NekDouble> > &qBar0,
89  Array<OneD, Array<OneD, NekDouble> > &q1,
90  Array<OneD, Array<OneD, NekDouble> > &qBar1);
91 
92  void SecondOrderFilter(const int i,
93  const Array<OneD, const Array<OneD, NekDouble> > &qBarMinus1,
94  const Array<OneD, const Array<OneD, NekDouble> > &q0,
95  const Array<OneD, const Array<OneD, NekDouble> > &qBar0,
96  Array<OneD, Array<OneD, NekDouble> > &q1,
97  Array<OneD, Array<OneD, NekDouble> > &qBar1);
98 
99 
100  protected:
101  /// Constructor
103 
104  /// Destructor
106 
107  /// Second-stage initialisation
108  SOLVER_UTILS_EXPORT virtual void v_InitObject(ostream &out = cout);
109 
110  /// Virtual function for solve implementation.
111  SOLVER_UTILS_EXPORT virtual void v_Execute(ostream &out = cout);
112 
113  static std::string driverLookupId;
114 
115  private:
116  //Definition of the SFD parameters:
122 
123  //For implementation of the exact solution of the filters equation
129 
130  int m_n;
131  int m_Check;
132 
135 
139 
141 
142  int MPIrank;
143 
146 
148 
149  std::ofstream m_file;
150  };
151  }
152 } //end of namespace
153 
154 #endif //NEKTAR_SOLVERUTILS_DRIVERSTEADYSTATE_H
155