Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // 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: TBA
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_LINEARISEDADVECTION_H
37 #define NEKTAR_SOLVERS_LINEARISEDADVECTION_H
38 
41 
42 
43 namespace Nektar
44 {
45 
47 {
49  {
52  };
53 
54  /// A map between matrix keys and their associated block
55  /// matrices.
56  typedef std::map< FloquetMatType, DNekBlkMatSharedPtr> FloquetBlockMatrixMap;
57  /// A shared pointer to a BlockMatrixMap.
58  typedef boost::shared_ptr<FloquetBlockMatrixMap> FloquetBlockMatrixMapShPtr;
59 
60 public:
62 
63  /// Creates an instance of this class
65  {
67  }
68  /// Name of class
69  static std::string className;
70 
71 protected:
73 
75  int m_expdim;
76 
77  /// Storage for base flow
80 
81  /// number of slices
82  int m_slices;
83  /// period length
85  /// interpolation vector
87  /// auxiliary variables
91  bool m_useFFTW;
92  /// flag to determine if use single mode or not
94  /// flag to determine if use half mode or not
95  bool m_halfMode;
96  /// flag to determine if use multiple mode or not
98 
100  FloquetMatType mattype,
101  bool UseContCoeffs = false) const;
103  FloquetMatType mattype,
104  bool UseContCoeffs = false) const;
105  FloquetBlockMatrixMapShPtr m_FloquetBlockMat;
106 
107 
109 
110  virtual ~LinearisedAdvection();
111 
112  virtual void v_InitObject(
115 
116  virtual void v_Advect(
117  const int nConvectiveFields,
119  const Array<OneD, Array<OneD, NekDouble> > &advVel,
120  const Array<OneD, Array<OneD, NekDouble> > &inarray,
121  Array<OneD, Array<OneD, NekDouble> > &outarray,
122  const NekDouble &time,
125 
126  virtual void v_SetBaseFlow(
127  const Array<OneD, Array<OneD, NekDouble> > &inarray,
129 
130  void UpdateBase(
131  const NekDouble m_slices,
132  const Array<OneD, const NekDouble> &inarray,
133  Array<OneD, NekDouble> &outarray,
134  const NekDouble m_time,
135  const NekDouble m_period);
136 
137  void UpdateGradBase(
138  const int var,
139  const MultiRegions::ExpListSharedPtr &field);
140 
141  void DFT(
142  const std::string file,
144  const NekDouble m_slices);
145 
146  /// Import Base flow
147  void ImportFldBase(
148  std::string pInfile,
150  int slice);
151 
152 private:
153  ///Parameter for homogeneous expansions
155  {
160  };
161 
162  /// flag to determine if use or not the FFT for transformations
163  bool m_useFFT;
164 
166 
167  NekDouble m_LhomX; ///< physical length in X direction (if homogeneous)
168  NekDouble m_LhomY; ///< physical length in Y direction (if homogeneous)
169  NekDouble m_LhomZ; ///< physical length in Z direction (if homogeneous)
170 
171  int m_npointsX; ///< number of points in X direction (if homogeneous)
172  int m_npointsY; ///< number of points in Y direction (if homogeneous)
173  int m_npointsZ; ///< number of points in Z direction (if homogeneous)
174 
175  int m_HomoDirec; ///< number of homogenous directions
176 
177  int m_NumMode; ///< Mode to use in case of single mode analysis
178 
180 };
181 
182 }
183 
184 #endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H
enum HomogeneousType m_HomogeneousType
Array< OneD, NekDouble > m_tmpIN
int m_HomoDirec
number of homogenous directions
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
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...
boost::shared_ptr< FloquetBlockMatrixMap > FloquetBlockMatrixMapShPtr
A shared pointer to a BlockMatrixMap.
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
void ImportFldBase(std::string pInfile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, int slice)
Import Base flow.
boost::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
Definition: Advection.h:165
int m_slices
number of slices
Array< OneD, NekDouble > m_tmpOUT
HomogeneousType
Parameter for homogeneous expansions.
FloquetBlockMatrixMapShPtr m_FloquetBlockMat
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
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)
DNekBlkMatSharedPtr GenFloquetBlockMatrix(FloquetMatType mattype, bool UseContCoeffs=false) const
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)
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
double NekDouble
NekDouble m_period
period length
DNekBlkMatSharedPtr GetFloquetBlockMatrix(FloquetMatType mattype, bool UseContCoeffs=false) const
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
boost::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:72
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.
boost::shared_ptr< BoundaryConditions > BoundaryConditionsSharedPtr
Definition: Conditions.h:284
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.
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)
NekDouble m_LhomZ
physical length in Z direction (if homogeneous)
bool m_useFFT
flag to determine if use or not the FFT for transformations
Array< OneD, Array< OneD, NekDouble > > m_gradBase
Defines a callback function which evaluates the flux vector.
Definition: Advection.h:69
boost::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:56