Nektar++
LinearisedAdvection.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File LinearisedAdvection.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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: TBA
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SOLVERS_LINEARISEDADVECTION_H
36 #define NEKTAR_SOLVERS_LINEARISEDADVECTION_H
37 
40 
41 
42 namespace Nektar
43 {
44 
46 {
48  {
51  };
52 
53  /// A map between matrix keys and their associated block
54  /// matrices.
55  typedef std::map< FloquetMatType, DNekBlkMatSharedPtr> FloquetBlockMatrixMap;
56  /// A shared pointer to a BlockMatrixMap.
57  typedef std::shared_ptr<FloquetBlockMatrixMap> FloquetBlockMatrixMapShPtr;
58 
59 public:
61 
62  /// Creates an instance of this class
64  {
66  }
67  /// Name of class
68  static std::string className;
69 
70 protected:
72 
74  int m_expdim;
75 
76  /// Storage for base flow
79 
80  /// number of slices
81  int m_slices;
82  /// period length
84  /// interpolation vector
86  /// auxiliary variables
90  bool m_useFFTW;
91  /// flag to determine if use single mode or not
93  /// flag to determine if use half mode or not
94  bool m_halfMode;
95  /// flag to determine if use multiple mode or not
97 
99  FloquetMatType mattype,
100  bool UseContCoeffs = false) const;
102  FloquetMatType mattype,
103  bool UseContCoeffs = false) const;
104  FloquetBlockMatrixMapShPtr m_FloquetBlockMat;
105 
106 
108 
109  virtual ~LinearisedAdvection();
110 
111  virtual void v_InitObject(
114 
115  virtual void v_Advect(
116  const int nConvectiveFields,
118  const Array<OneD, Array<OneD, NekDouble> > &advVel,
119  const Array<OneD, Array<OneD, NekDouble> > &inarray,
120  Array<OneD, Array<OneD, NekDouble> > &outarray,
121  const NekDouble &time,
124 
125  virtual void v_SetBaseFlow(
126  const Array<OneD, Array<OneD, NekDouble> > &inarray,
128 
129  void UpdateBase(
130  const NekDouble m_slices,
131  const Array<OneD, const NekDouble> &inarray,
132  Array<OneD, NekDouble> &outarray,
133  const NekDouble m_time,
134  const NekDouble m_period);
135 
136  void UpdateGradBase(
137  const int var,
138  const MultiRegions::ExpListSharedPtr &field);
139 
140  void DFT(
141  const std::string file,
143  const NekDouble m_slices);
144 
145  /// Import Base flow
146  void ImportFldBase(
147  std::string pInfile,
149  int slice);
150 
151 private:
152  ///Parameter for homogeneous expansions
154  {
159  };
160 
161  /// flag to determine if use or not the FFT for transformations
162  bool m_useFFT;
163 
165 
166  NekDouble m_LhomX; ///< physical length in X direction (if homogeneous)
167  NekDouble m_LhomY; ///< physical length in Y direction (if homogeneous)
168  NekDouble m_LhomZ; ///< physical length in Z direction (if homogeneous)
169 
170  int m_npointsX; ///< number of points in X direction (if homogeneous)
171  int m_npointsY; ///< number of points in Y direction (if homogeneous)
172  int m_npointsZ; ///< number of points in Z direction (if homogeneous)
173 
174  int m_HomoDirec; ///< number of homogenous directions
175 
176  int m_NumMode; ///< Mode to use in case of single mode analysis
177 
179 };
180 
181 }
182 
183 #endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H
enum HomogeneousType m_HomogeneousType
Array< OneD, NekDouble > m_tmpIN
int m_HomoDirec
number of homogenous directions
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
bool m_singleMode
flag to determine if use single mode or not
Array< OneD, Array< OneD, NekDouble > > m_baseflow
Storage for base flow.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::shared_ptr< BoundaryConditions > BoundaryConditionsSharedPtr
Definition: Conditions.h:289
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
Definition: Advection.h:170
virtual void v_SetBaseFlow(const Array< OneD, Array< OneD, NekDouble > > &inarray, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
Overrides the base flow used during linearised advection.
LibUtilities::NektarFFTSharedPtr m_FFT
auxiliary variables
DNekBlkMatSharedPtr GetFloquetBlockMatrix(FloquetMatType mattype, bool UseContCoeffs=false) const
void ImportFldBase(std::string pInfile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, int slice)
Import Base flow.
int m_slices
number of slices
Array< OneD, NekDouble > m_tmpOUT
HomogeneousType
Parameter for homogeneous expansions.
FloquetBlockMatrixMapShPtr m_FloquetBlockMat
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:71
Array< OneD, Array< OneD, NekDouble > > m_interp
interpolation vector
void UpdateBase(const NekDouble m_slices, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble m_time, const NekDouble m_period)
void DFT(const std::string file, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const NekDouble m_slices)
int m_npointsZ
number of points in Z direction (if homogeneous)
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
double NekDouble
NekDouble m_period
period length
int m_npointsY
number of points in Y direction (if homogeneous)
virtual void v_Advect(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &advVel, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time, const Array< OneD, Array< OneD, NekDouble > > &pFwd=NullNekDoubleArrayofArray, const Array< OneD, Array< OneD, NekDouble > > &pBwd=NullNekDoubleArrayofArray)
Advects a vector field.
bool m_multipleModes
flag to determine if use multiple mode or not
static SolverUtils::AdvectionSharedPtr create(std::string)
Creates an instance of this class.
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
NekDouble m_LhomY
physical length in Y direction (if homogeneous)
int m_NumMode
Mode to use in case of single mode analysis.
LibUtilities::SessionReaderSharedPtr m_session
int m_npointsX
number of points in X direction (if homogeneous)
NekDouble m_LhomX
physical length in X direction (if homogeneous)
static std::string className
Name of class.
bool m_halfMode
flag to determine if use half mode or not
std::map< FloquetMatType, DNekBlkMatSharedPtr > FloquetBlockMatrixMap
A map between matrix keys and their associated block matrices.
std::shared_ptr< FloquetBlockMatrixMap > FloquetBlockMatrixMapShPtr
A shared pointer to a BlockMatrixMap.
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayofArray
void UpdateGradBase(const int var, const MultiRegions::ExpListSharedPtr &field)
DNekBlkMatSharedPtr GenFloquetBlockMatrix(FloquetMatType mattype, bool UseContCoeffs=false) const
std::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:55
NekDouble m_LhomZ
physical length in Z direction (if homogeneous)
bool m_useFFT
flag to determine if use or not the FFT for transformations
std::shared_ptr< SessionReader > SessionReaderSharedPtr
Array< OneD, Array< OneD, NekDouble > > m_gradBase
An abstract base class encapsulating the concept of advection of a vector field.
Definition: Advection.h:69