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
41namespace Nektar
42{
43
45{
47 {
50 };
51
52 /// A map between matrix keys and their associated block
53 /// matrices.
54 typedef std::map<FloquetMatType, DNekBlkMatSharedPtr> FloquetBlockMatrixMap;
55 /// A shared pointer to a BlockMatrixMap.
56 typedef std::shared_ptr<FloquetBlockMatrixMap> FloquetBlockMatrixMapShPtr;
57
58public:
60
61 /// Creates an instance of this class
63 {
65 }
66 /// Name of class
67 static std::string className;
68
69protected:
71
74
75 /// Storage for base flow
78
79 /// number of slices
81 int m_skip;
83 /// period length
87 /// interpolation vector
89 /// auxiliary variables
94 /// flag to determine if use single mode or not
96 /// flag to determine if use half mode or not
98 /// flag to determine if use multiple mode or not
100
102 bool UseContCoeffs = false) const;
104 bool UseContCoeffs = false) const;
106
108
109 ~LinearisedAdvection() override;
110
111 void v_InitObject(
114
115 void v_Advect(const int nConvectiveFields,
117 const Array<OneD, Array<OneD, NekDouble>> &advVel,
118 const Array<OneD, Array<OneD, NekDouble>> &inarray,
120 const NekDouble &time,
121 const Array<OneD, Array<OneD, NekDouble>> &pFwd =
123 const Array<OneD, Array<OneD, NekDouble>> &pBwd =
125
126 void v_SetBaseFlow(
127 const Array<OneD, Array<OneD, NekDouble>> &inarray,
128 const Array<OneD, MultiRegions::ExpListSharedPtr> &fields) override;
129
130 void UpdateBase(const Array<OneD, const NekDouble> &inarray,
131 Array<OneD, NekDouble> &outarray, const NekDouble time);
132
133 void UpdateGradBase(const int var,
135
136 void DFT(const std::string file,
138
139 /// Import Base flow
140 void ImportFldBase(std::string pInfile,
142 int slice);
143
144private:
145 /// Parameter for homogeneous expansions
147 {
152 };
153
154 /// flag to determine if use or not the FFT for transformations
156
158
159 NekDouble m_LhomX; ///< physical length in X direction (if homogeneous)
160 NekDouble m_LhomY; ///< physical length in Y direction (if homogeneous)
161 NekDouble m_LhomZ; ///< physical length in Z direction (if homogeneous)
162
163 int m_npointsX; ///< number of points in X direction (if homogeneous)
164 int m_npointsY; ///< number of points in Y direction (if homogeneous)
165 int m_npointsZ; ///< number of points in Z direction (if homogeneous)
166
167 int m_HomoDirec; ///< number of homogenous directions
168
169 int m_NumMode; ///< Mode to use in case of single mode analysis
170
172};
173
174} // namespace Nektar
175
176#endif // NEKTAR_SOLVERS_INCNAVIERSTOKES_H
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
int m_npointsZ
number of points in Z direction (if homogeneous)
NekDouble m_LhomZ
physical length in Z direction (if homogeneous)
FloquetBlockMatrixMapShPtr m_FloquetBlockMat
void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override
Initialises the advection object.
enum HomogeneousType m_HomogeneousType
void UpdateBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble time)
NekDouble m_period
period length
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) override
Advects a vector field.
int m_npointsX
number of points in X direction (if homogeneous)
int m_npointsY
number of points in Y direction (if homogeneous)
DNekBlkMatSharedPtr GenFloquetBlockMatrix(FloquetMatType mattype, bool UseContCoeffs=false) const
int m_HomoDirec
number of homogenous directions
static SolverUtils::AdvectionSharedPtr create(std::string)
Creates an instance of this class.
bool m_useFFT
flag to determine if use or not the FFT for transformations
void v_SetBaseFlow(const Array< OneD, Array< OneD, NekDouble > > &inarray, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields) override
Overrides the base flow used during linearised advection.
LibUtilities::SessionReaderSharedPtr m_session
Array< OneD, NekDouble > m_tmpIN
void UpdateGradBase(const int var, const MultiRegions::ExpListSharedPtr &field)
DNekBlkMatSharedPtr GetFloquetBlockMatrix(FloquetMatType mattype, bool UseContCoeffs=false) const
bool m_singleMode
flag to determine if use single mode or not
HomogeneousType
Parameter for homogeneous expansions.
Array< OneD, Array< OneD, NekDouble > > m_baseflow
Storage for base flow.
Array< OneD, NekDouble > m_tmpOUT
Array< OneD, Array< OneD, NekDouble > > m_gradBase
bool m_multipleModes
flag to determine if use multiple mode or not
void DFT(const std::string file, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
LibUtilities::NektarFFTSharedPtr m_FFT
auxiliary variables
bool m_halfMode
flag to determine if use half mode or not
int m_NumMode
Mode to use in case of single mode analysis.
NekDouble m_LhomY
physical length in Y direction (if homogeneous)
void ImportFldBase(std::string pInfile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, int slice)
Import Base flow.
std::shared_ptr< FloquetBlockMatrixMap > FloquetBlockMatrixMapShPtr
A shared pointer to a BlockMatrixMap.
NekDouble m_LhomX
physical length in X direction (if homogeneous)
Array< OneD, Array< OneD, NekDouble > > m_interp
interpolation vector
static std::string className
Name of class.
std::map< FloquetMatType, DNekBlkMatSharedPtr > FloquetBlockMatrixMap
A map between matrix keys and their associated block matrices.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
An abstract base class encapsulating the concept of advection of a vector field.
Definition: Advection.h:81
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:58
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< Advection > AdvectionSharedPtr
A shared pointer to an Advection object.
Definition: Advection.h:54
std::shared_ptr< BoundaryConditions > BoundaryConditionsSharedPtr
Definition: Conditions.h:289
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:77
static Array< OneD, Array< OneD, NekDouble > > NullNekDoubleArrayOfArray
double NekDouble