Nektar++
ExpListHomogeneous2D.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: ExpListHomogeneous2D.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: Base class for expansions which are homogeneous in 2
32// directions
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef EXPLISTHOMO2D_H
37#define EXPLISTHOMO2D_H
43#include <vector>
44
46{
47
49{
58};
59
60/// A map between homo matrix keys and their associated block
61/// matrices.
62typedef std::map<Homogeneous2DMatType, DNekBlkMatSharedPtr>
64/// A shared pointer to a BlockMatrixMap.
65typedef std::shared_ptr<Homo2DBlockMatrixMap> Homo2DBlockMatrixMapShPtr;
66
67// Forward declaration for typedefs
69
70/// Shared pointer to an ExpList3DHomogeneous2D object.
71typedef std::shared_ptr<ExpListHomogeneous2D> ExpListHomogeneous2DSharedPtr;
72/// Vector of pointers to ExpList3DHomogeneous2D objects.
73typedef std::vector<ExpListHomogeneous2DSharedPtr> ExpListHomogeneous2DVector;
74
75/// Abstraction of a two-dimensional multi-elemental expansion which
76/// is merely a collection of local expansions.
78{
79public:
80 /// Default constructor.
82
84 const ExpansionType type,
86 const LibUtilities::BasisKey &HomoBasis_y,
87 const LibUtilities::BasisKey &HomoBasis_z, const NekDouble ly,
88 const NekDouble lz, const bool useFFT, const bool dealiasing);
89
90 /// Copy constructor.
92
94 const ExpListHomogeneous2D &In, const std::vector<unsigned int> &eIDs);
95 /// Destructor.
97
99 const int npts, const Array<OneD, const NekDouble> &inarray,
100 Array<OneD, NekDouble> &outarray, bool IsForwards, bool Shuff = true,
101 bool UnShuff = true);
102
104
106 const Array<OneD, const NekDouble> &inarray,
108 Array<OneD, NekDouble> &out_d2);
109
111 Direction edir, const Array<OneD, const NekDouble> &inarray,
113
114 /// FFT variables
120
124
125protected:
126 /// Definition of the total number of degrees of freedom and
127 /// quadrature points. Sets up the storage for \a m_coeff and \a
128 /// m_phys.
130 m_homogeneousBasis_y; ///< Base expansion in y direction
132 m_homogeneousBasis_z; ///< Base expansion in z direction
134 m_paddingBasis_y; ///< Base expansion in y direction
136 m_paddingBasis_z; ///< Base expansion in z direction
137 NekDouble m_lhom_y; ///< Width of homogeneous direction y
138 NekDouble m_lhom_z; ///< Width of homogeneous direction z
141 m_lines; ///< Vector of ExpList, will be filled with ExpList1D
142 int m_ny; ///< Number of modes = number of poitns in y direction
143 int m_nz; ///< Number of modes = number of poitns in z direction
144
146 Homogeneous2DMatType mattype) const;
147
149 Homogeneous2DMatType mattype) const;
150
151 // virtual functions
152 size_t v_GetNumElmts(void) override
153 {
154 return m_lines[0]->GetExpSize();
155 }
156
157 void v_FwdTrans(const Array<OneD, const NekDouble> &inarray,
158 Array<OneD, NekDouble> &outarray) override;
159
161 Array<OneD, NekDouble> &outarray) override;
162
164 Array<OneD, NekDouble> &outarray) override;
165
166 void v_BwdTrans(const Array<OneD, const NekDouble> &inarray,
167 Array<OneD, NekDouble> &outarray) override;
168
170 Array<OneD, NekDouble> &outarray) override;
171
172 std::vector<LibUtilities::FieldDefinitionsSharedPtr> v_GetFieldDefinitions(
173 void) override;
174
176 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef)
177 override;
178
180 std::vector<NekDouble> &fielddata) override;
181
183 std::vector<NekDouble> &fielddata,
184 Array<OneD, NekDouble> &coeffs) override;
185
188 std::vector<NekDouble> &fielddata, std::string &field,
190 std::unordered_map<int, int> zIdToPlane) override;
191
192 void v_WriteVtkPieceData(std::ostream &outfile, int expansion,
193 std::string var) override;
194
195 void v_HomogeneousFwdTrans(const int npts,
196 const Array<OneD, const NekDouble> &inarray,
197 Array<OneD, NekDouble> &outarray,
198 bool Shuff = true, bool UnShuff = true) override;
199
200 void v_HomogeneousBwdTrans(const int npts,
201 const Array<OneD, const NekDouble> &inarray,
202 Array<OneD, NekDouble> &outarray,
203 bool Shuff = true, bool UnShuff = true) override;
204
205 void v_DealiasedProd(const int num_dofs,
206 const Array<OneD, NekDouble> &inarray1,
207 const Array<OneD, NekDouble> &inarray2,
208 Array<OneD, NekDouble> &outarray) override;
209
211 const int num_dofs, const Array<OneD, Array<OneD, NekDouble>> &inarray1,
212 const Array<OneD, Array<OneD, NekDouble>> &inarray2,
213 Array<OneD, Array<OneD, NekDouble>> &outarray) override;
214
215 void v_PhysDeriv(const Array<OneD, const NekDouble> &inarray,
218 Array<OneD, NekDouble> &out_d2) override;
219
220 void v_PhysDeriv(Direction edir,
221 const Array<OneD, const NekDouble> &inarray,
222 Array<OneD, NekDouble> &out_d) override;
223
224private:
225 // Padding operations variables
231};
232
233} // namespace Nektar::MultiRegions
234
235#endif // EXPLISTHOMO2D_H
#define MULTI_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
void v_DealiasedProd(const int num_dofs, const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray) override
void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_DealiasedDotProd(const int num_dofs, const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray) override
void v_FwdTransLocalElmt(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void) override
DNekBlkMatSharedPtr GenHomogeneous2DBlockMatrix(Homogeneous2DMatType mattype) const
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
LibUtilities::NektarFFTSharedPtr m_FFT_y
ExpListHomogeneous2D(const ExpansionType type)
Default constructor.
int m_nz
Number of modes = number of poitns in z direction.
LibUtilities::NektarFFTSharedPtr m_FFT_z
LibUtilities::BasisSharedPtr m_homogeneousBasis_y
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
NekDouble m_lhom_z
Width of homogeneous direction z.
int m_ny
Number of modes = number of poitns in y direction.
void PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
void v_HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true) override
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var) override
LibUtilities::TranspositionSharedPtr m_transposition
Array< OneD, ExpListSharedPtr > m_lines
Vector of ExpList, will be filled with ExpList1D.
LibUtilities::BasisSharedPtr m_homogeneousBasis_z
Base expansion in z direction.
LibUtilities::BasisSharedPtr m_paddingBasis_z
Base expansion in z direction.
void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata) override
void v_ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs, std::unordered_map< int, int > zIdToPlane) override
Extract data from raw field data into expansion list.
void Homogeneous2DTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool IsForwards, bool Shuff=true, bool UnShuff=true)
DNekBlkMatSharedPtr GetHomogeneous2DBlockMatrix(Homogeneous2DMatType mattype) const
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
LibUtilities::BasisSharedPtr m_paddingBasis_y
Base expansion in y direction.
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
NekDouble m_lhom_y
Width of homogeneous direction y.
void v_HomogeneousBwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true) override
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:99
std::shared_ptr< Basis > BasisSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
Definition: FieldIO.h:184
std::shared_ptr< NektarFFT > NektarFFTSharedPtr
Definition: NektarFFT.h:58
std::shared_ptr< Transposition > TranspositionSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
std::map< Homogeneous2DMatType, DNekBlkMatSharedPtr > Homo2DBlockMatrixMap
A map between homo matrix keys and their associated block matrices.
std::vector< ExpListHomogeneous2DSharedPtr > ExpListHomogeneous2DVector
Vector of pointers to ExpList3DHomogeneous2D objects.
std::shared_ptr< ExpListHomogeneous2D > ExpListHomogeneous2DSharedPtr
Shared pointer to an ExpList3DHomogeneous2D object.
std::shared_ptr< Homo2DBlockMatrixMap > Homo2DBlockMatrixMapShPtr
A shared pointer to a BlockMatrixMap.
std::shared_ptr< DNekBlkMat > DNekBlkMatSharedPtr
Definition: NekTypeDefs.hpp:77
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble