Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AdvectionTerm.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: Base class for Navier-Stokes advection term
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_ADVECTIONTERM_H
37 #define NEKTAR_SOLVERS_ADVECTIONTERM_H
38 
41 #include <LibUtilities/FFT/NektarFFT.h> // for NektarFFTSharedPtr
42 #include <SpatialDomains/MeshGraph.h> // for MeshGraphSharedPtr
43 #include <MultiRegions/ExpList.h> // for ExpListSharedPtr
44 
45 
46 namespace Nektar
47 {
49 
50  /// A shared pointer to an EquationSystem object
51  typedef boost::shared_ptr<AdvectionTerm> AdvectionTermSharedPtr;
52  /// Datatype of the NekFactory used to instantiate classes derived from
53  /// the EquationSystem class.
55  std::string, AdvectionTerm,
60 
61  /// Base class for the development of solvers.
63  {
64  public:
65  /// Destructor
66  virtual ~AdvectionTerm();
67 
68  inline void InitObject();
69 
70  /// Compute advection term
71  void DoAdvection(Array<OneD, MultiRegions::ExpListSharedPtr > &pFields,
72  const int nConvectiveFields,
73  const Array<OneD, int> &vel_loc,
74  const Array<OneD, const Array<OneD, NekDouble> > &pInarray,
75  Array<OneD, Array<OneD, NekDouble> > &pOutarray,
76  NekDouble m_time,
77  Array<OneD, NekDouble> &pWk = NullNekDouble1DArray);
78 
79  void DoAdvection(Array<OneD, MultiRegions::ExpListSharedPtr > &pFields,
80  const Array<OneD, const Array<OneD, NekDouble> > &Velocity,
81  const Array<OneD, const Array<OneD, NekDouble> > &pInarray,
82  Array<OneD, Array<OneD, NekDouble> > &pOutarray,
83  NekDouble m_time,
84  Array<OneD, NekDouble> &pWk = NullNekDouble1DArray);
85 
87  {
88  return m_specHP_dealiasing;
89  }
90 
91  void SetSpecHPDealiasing(bool value)
92  {
93  m_specHP_dealiasing = value;
94  }
95  protected:
97  /// Name of the session
98  std::string m_sessionName;
99  /// Pointer to mesh graph
101 
102  bool m_homogen_dealiasing; ///< flag to determine if use Fourier dealising or not
103  bool m_specHP_dealiasing; ///< flag to determine if use Spectral/hp element dealising or not
104  bool m_SingleMode; ///< Flag to determine if use single mode or not
105  bool m_HalfMode; ///< Flag to determine if use half mode or not
106 
108 
109  /// Type of projection, i.e. Galerkin or DG.
111 
112  int m_spacedim; ///< Spatial dimension (> expansion dim)
113  int m_expdim; ///< Dimension of the expansion
114  int nvariables; ///< Number of variables
115 
116  int m_nConvectiveFields; /// Number of fields to be convected;
117 
118  //number of slices
119  int m_slices;
120  //period length
122  //interpolation vector
123  Array<OneD, Array<OneD, NekDouble> > m_interp;
124  //auxiliary variables for time depedent base flows
126  Array<OneD,NekDouble> m_tmpIN;
127  Array<OneD,NekDouble> m_tmpOUT;
128 
129  bool m_useFFTW;
130 
131  /// Constructor
133  const SpatialDomains::MeshGraphSharedPtr& pGraph);
134 
135  virtual void v_InitObject();
136 
137  virtual void v_ComputeAdvectionTerm(Array<OneD, MultiRegions::ExpListSharedPtr > &pFields,
138  const Array<OneD, Array<OneD, NekDouble> > &pV,
139  const Array<OneD, const NekDouble> &pU,
140  Array<OneD, NekDouble> &pOutarray,
141  int pVelocityComponent,
142  NekDouble m_time,
143  Array<OneD, NekDouble> &pWk)
144  {
145  ASSERTL0(false,"This function is not defined in parent class");
146  };
147  };
148 
150  {
151  v_InitObject();
152  }
153 } //end of namespace
154 
155 #endif //NEKTAR_SOLVERS_AUXILIARY_ADRBASE_H
156