Nektar++
QuadExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: QuadExp.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: Expansion for quadrilateral elements.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef QUADEXP_H
36#define QUADEXP_H
37
44
46{
47
48class QuadExp : virtual public StdRegions::StdQuadExp,
49 virtual public Expansion2D
50{
51public:
52 /**
53 * @brief Constructor using BasisKey class for quadrature
54 * points and order definition
55 */
59
61
62 LOCAL_REGIONS_EXPORT ~QuadExp() override = default;
63
64protected:
65 //-------------------------------
66 // Integration Methods
67 //-------------------------------
69 v_Integral(const Array<OneD, const NekDouble> &inarray) override;
70
71 //----------------------------
72 // Differentiation Methods
73 //----------------------------
76 const Array<OneD, const NekDouble> &physvals) override;
78 const Array<OneD, const NekDouble> &inarray,
82 const int dir, const Array<OneD, const NekDouble> &inarray,
83 Array<OneD, NekDouble> &outarray) override;
85 const Array<OneD, const NekDouble> &inarray,
86 const Array<OneD, const NekDouble> &direction,
87 Array<OneD, NekDouble> &out) override;
88
89 //---------------------------------------
90 // Transforms
91 //---------------------------------------
93 const Array<OneD, const NekDouble> &inarray,
94 Array<OneD, NekDouble> &outarray) override;
95
97 const Array<OneD, const NekDouble> &inarray,
98 Array<OneD, NekDouble> &outarray) override;
99
100 //---------------------------------------
101 // Inner product functions
102 //---------------------------------------
104 const Array<OneD, const NekDouble> &inarray,
105 Array<OneD, NekDouble> &outarray) override;
107 const int dir, const Array<OneD, const NekDouble> &inarray,
108 Array<OneD, NekDouble> &outarray) override;
110 const Array<OneD, const NekDouble> &inarray,
111 Array<OneD, NekDouble> &outarray,
112 bool multiplybyweights = true) override;
114 const int dir, const Array<OneD, const NekDouble> &inarray,
115 Array<OneD, NekDouble> &outarray) override;
117 const int dir, const Array<OneD, const NekDouble> &inarray,
118 Array<OneD, Array<OneD, NekDouble>> &outarray) override;
119
124 Array<OneD, NekDouble> &outarray) override;
125
127 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
128 Array<OneD, NekDouble> &outarray) override;
129
130 //---------------------------------------
131 // Evaluation functions
132 //---------------------------------------
134 void) const override;
135
137 void) const override;
138
140 const Array<OneD, const NekDouble> &Lcoords,
141 Array<OneD, NekDouble> &coords) override;
144 Array<OneD, NekDouble> &coords_3) override;
147 const Array<OneD, const NekDouble> &physvals) override;
150 const Array<OneD, const NekDouble> &inarray,
151 std::array<NekDouble, 3> &firstOrderDerivs) override;
153 const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp,
154 const Array<OneD, const NekDouble> &inarray,
155 Array<OneD, NekDouble> &outarray,
156 StdRegions::Orientation orient) override;
157
159 const int edge, Array<OneD, NekDouble> &outarray) override;
160 LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int edge) override;
161
162 //---------------------------------------
163 // Helper functions
164 //---------------------------------------
166 const NekDouble *data, const std::vector<unsigned int> &nummodes,
167 const int mode_offset, NekDouble *coeffs,
168 std::vector<LibUtilities::BasisType> &fromType) override;
170 int edge) override;
172 const int edge, Array<OneD, int> &outarray) override;
173
174 //---------------------------------------
175 // Matrix creation functions
176 //---------------------------------------
178 v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override;
179
181 v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override;
182
184 v_GetLocMatrix(const MatrixKey &mkey) override;
185
186 LOCAL_REGIONS_EXPORT void v_DropLocMatrix(const MatrixKey &mkey) override;
187
189 v_GetLocStaticCondMatrix(const MatrixKey &mkey) override;
190
192 const MatrixKey &mkey) override;
193
194 //---------------------------------------
195 // Operators
196 //---------------------------------------
198 const Array<OneD, const NekDouble> &inarray,
199 Array<OneD, NekDouble> &outarray,
200 const StdRegions::StdMatrixKey &mkey) override;
202 const Array<OneD, const NekDouble> &inarray,
203 Array<OneD, NekDouble> &outarray,
204 const StdRegions::StdMatrixKey &mkey) override;
206 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
207 Array<OneD, NekDouble> &outarray,
208 const StdRegions::StdMatrixKey &mkey) override;
210 const int i, const Array<OneD, const NekDouble> &inarray,
211 Array<OneD, NekDouble> &outarray,
212 const StdRegions::StdMatrixKey &mkey) override;
214 const Array<OneD, const NekDouble> &inarray,
215 Array<OneD, NekDouble> &outarray,
216 const StdRegions::StdMatrixKey &mkey) override;
218 const Array<OneD, const NekDouble> &inarray,
219 Array<OneD, NekDouble> &outarray,
220 const StdRegions::StdMatrixKey &mkey) override;
222 const Array<OneD, const NekDouble> &inarray,
223 Array<OneD, NekDouble> &outarray,
224 const StdRegions::StdMatrixKey &mkey) override;
226 const Array<OneD, const NekDouble> &inarray,
227 Array<OneD, NekDouble> &outarray, Array<OneD, NekDouble> &wsp) override;
229 int numMin, const Array<OneD, const NekDouble> &inarray,
230 Array<OneD, NekDouble> &outarray) override;
232
235 const StdRegions::StdMatrixKey &mkey) override;
236
239 Array<OneD, Array<OneD, NekDouble>> &d0factors,
240 Array<OneD, Array<OneD, NekDouble>> &d1factors) override;
241
242private:
247
248 void GetEdgeInterpVals(const int edge,
249 const Array<OneD, const NekDouble> &inarray,
250 Array<OneD, NekDouble> &outarray);
251
253};
254
255typedef std::shared_ptr<QuadExp> QuadExpSharedPtr;
256typedef std::vector<QuadExpSharedPtr> QuadExpVector;
257} // namespace Nektar::LocalRegions
258
259#endif
#define LOCAL_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1401
StdRegions::Orientation v_GetTraceOrient(int edge) override
Definition: QuadExp.cpp:1346
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: QuadExp.cpp:1391
void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Transform a given function from physical quadrature space to coefficient space.
Definition: QuadExp.cpp:227
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition: QuadExp.cpp:1381
~QuadExp() override=default
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition: QuadExp.cpp:527
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1445
void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Definition: QuadExp.cpp:545
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the basis B=base0*base1 and put into outarray.
Definition: QuadExp.cpp:370
void v_ComputeLaplacianMetric() override
Definition: QuadExp.cpp:1549
void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
Definition: QuadExp.cpp:1492
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: QuadExp.cpp:390
void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Definition: QuadExp.cpp:452
void GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:657
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: QuadExp.cpp:418
void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray) override
Definition: QuadExp.cpp:486
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1408
NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
This function evaluates the expansion at a single (arbitrary) point of the domain.
Definition: QuadExp.cpp:574
void v_GetTracePhysVals(const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
Definition: QuadExp.cpp:595
void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1431
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
Calculate the derivative of the physical points.
Definition: QuadExp.cpp:92
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrates the specified function over the domain.
Definition: QuadExp.cpp:69
void v_DropLocMatrix(const MatrixKey &mkey) override
Definition: QuadExp.cpp:1386
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: QuadExp.h:244
void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
Definition: QuadExp.cpp:1256
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: QuadExp.cpp:538
void v_ComputeTraceNormal(const int edge) override
Definition: QuadExp.cpp:977
void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &out) override
Physical derivative along a direction vector.
Definition: QuadExp.cpp:181
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: QuadExp.h:246
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition: QuadExp.cpp:521
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1351
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: QuadExp.cpp:1396
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: QuadExp.cpp:383
void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1438
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1371
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1586
void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors) override
: This method gets all of the factors which are required as part of the Gradient Jump Penalty (GJP) s...
Definition: QuadExp.cpp:1618
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
Definition: QuadExp.cpp:566
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: QuadExp.cpp:250
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: QuadExp.cpp:1452
void v_GetTracePhysMap(const int edge, Array< OneD, int > &outarray) override
Definition: QuadExp.cpp:721
void v_GetTraceQFactors(const int edge, Array< OneD, NekDouble > &outarray) override
Definition: QuadExp.cpp:763
void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: QuadExp.cpp:1423
std::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:255
std::vector< QuadExpSharedPtr > QuadExpVector
Definition: QuadExp.h:256
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:62
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
StdRegions::ConstFactorMap factors
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble