Nektar++
StdQuadExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: StdQuadExp.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: Header field for Quadrilateral routines built upon
32// StdExpansion2D
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef NEKTAR_LIB_STDREGIONS_STDQUADEXP_H
37#define NEKTAR_LIB_STDREGIONS_STDQUADEXP_H
38
41
42namespace Nektar::StdRegions
43{
44class StdQuadExp : virtual public StdExpansion2D
45{
46public:
48 const LibUtilities::BasisKey &Bb);
50 STD_REGIONS_EXPORT ~StdQuadExp() override = default;
51
52protected:
53 //-------------------------------
54 // Integration Methods
55 //-------------------------------
57 v_Integral(const Array<OneD, const NekDouble> &inarray) override;
58
59 //-------------------------------
60 // Differentiation Methods
61 //-------------------------------
63 const Array<OneD, const NekDouble> &inarray,
67 const int dir, const Array<OneD, const NekDouble> &inarray,
68 Array<OneD, NekDouble> &outarray) override;
70 const Array<OneD, const NekDouble> &inarray,
74 const int dir, const Array<OneD, const NekDouble> &inarray,
75 Array<OneD, NekDouble> &outarray) override;
76
77 //---------------------------------------
78 // Transforms
79 //---------------------------------------
81 const Array<OneD, const NekDouble> &inarray,
82 Array<OneD, NekDouble> &outarray) override;
84 const Array<OneD, const NekDouble> &inarray,
85 Array<OneD, NekDouble> &outarray) override;
89 const Array<OneD, const NekDouble> &inarray,
91 bool doCheckCollDir0, bool doCheckCollDir1) override;
93 const Array<OneD, const NekDouble> &inarray,
94 Array<OneD, NekDouble> &outarray) override;
96 const Array<OneD, const NekDouble> &inarray,
97 Array<OneD, NekDouble> &outarray) override;
98
99 //---------------------------------------
100 // Inner product functions
101 //---------------------------------------
103 const Array<OneD, const NekDouble> &inarray,
104 Array<OneD, NekDouble> &outarray) override;
106 const Array<OneD, const NekDouble> &inarray,
107 Array<OneD, NekDouble> &outarray,
108 bool multiplybyweights = true) override;
110 const Array<OneD, const NekDouble> &base0,
111 const Array<OneD, const NekDouble> &base1,
112 const Array<OneD, const NekDouble> &inarray,
114 bool doCheckCollDir0, bool doCheckCollDir1) override;
116 const int dir, const Array<OneD, const NekDouble> &inarray,
117 Array<OneD, NekDouble> &outarray) override;
119 const int dir, const Array<OneD, const NekDouble> &inarray,
120 Array<OneD, NekDouble> &outarray) override;
121
122 //---------------------------------------
123 // Evaluation functions
124 //---------------------------------------
127 Array<OneD, NekDouble> &eta) override;
130 Array<OneD, NekDouble> &xi) override;
131 STD_REGIONS_EXPORT void v_FillMode(const int mode,
132 Array<OneD, NekDouble> &array) override;
133
134 //---------------------------
135 // Helper functions
136 //---------------------------
137 STD_REGIONS_EXPORT int v_GetNverts() const final;
138 STD_REGIONS_EXPORT int v_GetNtraces() const final;
139 STD_REGIONS_EXPORT int v_GetTraceNcoeffs(const int i) const final;
140 STD_REGIONS_EXPORT int v_GetTraceIntNcoeffs(const int i) const final;
141 STD_REGIONS_EXPORT int v_GetTraceNumPoints(const int i) const final;
142 STD_REGIONS_EXPORT int v_NumBndryCoeffs() const final;
143 STD_REGIONS_EXPORT int v_NumDGBndryCoeffs() const final;
145 const std::vector<unsigned int> &nummodes, int &modes_offset) override;
147 const int i, const int j) const final;
148 STD_REGIONS_EXPORT LibUtilities::ShapeType v_DetShapeType() const final;
151 Array<OneD, NekDouble> &coords_0, Array<OneD, NekDouble> &coords_1,
152 Array<OneD, NekDouble> &coords_2) override;
154 const Array<OneD, const NekDouble> &coords, int mode) override;
156 const Array<OneD, NekDouble> &coord,
157 const Array<OneD, const NekDouble> &inarray,
158 std::array<NekDouble, 3> &firstOrderDerivs) override
159 {
160 return BaryTensorDeriv(coord, inarray, firstOrderDerivs);
161 }
162
163 //--------------------------
164 // Mappings
165 //--------------------------
167 Array<OneD, unsigned int> &outarray) override;
169 Array<OneD, unsigned int> &outarray) override;
171 int localVertexId, bool useCoeffPacking = false) override;
173 const unsigned int traceid,
174 Array<OneD, unsigned int> &maparray) override;
176 const int eid, Array<OneD, unsigned int> &maparray,
177 Array<OneD, int> &signarray,
178 const Orientation edgeOrient = eForwards) override;
179
180 //---------------------------------------
181 // Wrapper functions
182 //---------------------------------------
184 v_GenMatrix(const StdMatrixKey &mkey) override;
186 v_CreateStdMatrix(const StdMatrixKey &mkey) override;
187
188 //---------------------------------------
189 // Operator evaluation functions
190 //---------------------------------------
192 const Array<OneD, const NekDouble> &inarray,
193 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
195 const Array<OneD, const NekDouble> &inarray,
196 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
198 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
199 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
201 const int i, const Array<OneD, const NekDouble> &inarray,
202 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
204 const Array<OneD, const NekDouble> &inarray,
205 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
207 Array<OneD, NekDouble> &array, const StdMatrixKey &mkey) override;
209 Array<OneD, NekDouble> &array, const NekDouble alpha,
210 const NekDouble exponent, const NekDouble cutoff) override;
212 int numMin, const Array<OneD, const NekDouble> &inarray,
213 Array<OneD, NekDouble> &outarray) override;
215 const Array<OneD, const NekDouble> &inarray,
216 Array<OneD, NekDouble> &outarray) override;
217
218 //---------------------------------------
219 // Output interpolation functions
220 //---------------------------------------
222 Array<OneD, int> &conn, bool standard = true) override;
223};
224typedef std::shared_ptr<StdQuadExp> StdQuadExpSharedPtr;
225
226} // namespace Nektar::StdRegions
227
228#endif // STDQUADEXP_H
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
NekDouble BaryTensorDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
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: StdQuadExp.cpp:204
void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdQuadExp.cpp:141
void v_ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff) override
void v_BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1) override
Definition: StdQuadExp.cpp:161
int v_NumDGBndryCoeffs() const final
Definition: StdQuadExp.cpp:640
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdQuadExp.cpp:227
void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
Definition: StdQuadExp.cpp:501
int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false) override
Definition: StdQuadExp.cpp:848
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdQuadExp.cpp:402
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
bool v_IsBoundaryInteriorExpansion() const override
Definition: StdQuadExp.cpp:663
int v_GetTraceNcoeffs(const int i) const final
Definition: StdQuadExp.cpp:565
int v_GetNtraces() const final
Definition: StdQuadExp.cpp:560
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
int v_GetTraceNumPoints(const int i) const final
Definition: StdQuadExp.cpp:592
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
int v_NumBndryCoeffs() const final
Definition: StdQuadExp.cpp:626
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2) override
Definition: StdQuadExp.cpp:680
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) override
This function evaluates the basis function mode mode at a point coords of the domain.
Definition: StdQuadExp.cpp:709
int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset) override
Definition: StdQuadExp.cpp:654
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: StdQuadExp.cpp:354
StdQuadExp(const StdQuadExp &T)=default
void v_GetInteriorMap(Array< OneD, unsigned int > &outarray) override
Definition: StdQuadExp.cpp:795
int v_GetNverts() const final
Definition: StdQuadExp.cpp:555
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrates the specified function over the domain.
Definition: StdQuadExp.cpp:58
void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
Definition: StdQuadExp.cpp:108
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdQuadExp.cpp:127
void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
Definition: StdQuadExp.cpp:508
NekDouble v_PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
Definition: StdQuadExp.h:155
void v_GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
Get the map of the coefficient location to teh local trace coefficients.
Definition: StdQuadExp.cpp:963
DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey) override
~StdQuadExp() override=default
void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true) override
void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: StdQuadExp.cpp:367
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdQuadExp.cpp:395
void v_IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1) override
Definition: StdQuadExp.cpp:443
void v_GetTraceInteriorToElementMap(const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation edgeOrient=eForwards) override
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: StdQuadExp.cpp:76
void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray) override
Definition: StdQuadExp.cpp:728
DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey) override
int v_GetTraceIntNcoeffs(const int i) const final
Definition: StdQuadExp.cpp:579
StdQuadExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb)
Constructor using BasisKey class for quadrature points and order definition.
Definition: StdQuadExp.cpp:47
const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int j) const final
Definition: StdQuadExp.cpp:606
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
LibUtilities::ShapeType v_DetShapeType() const final
Definition: StdQuadExp.cpp:621
void v_FillMode(const int mode, Array< OneD, NekDouble > &array) override
Fill outarray with mode mode of expansion.
Definition: StdQuadExp.cpp:521
std::shared_ptr< StdQuadExp > StdQuadExpSharedPtr
Definition: StdQuadExp.h:224
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble
STL namespace.