Nektar++
StdPyrExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: StdPyrExp.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 pyramidic routines built upon
32// StdExpansion3D
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef NEKTAR_LIBS_STDREGIONS_STDPYREXP_H
37#define NEKTAR_LIBS_STDREGIONS_STDPYREXP_H
38
40
41namespace Nektar::StdRegions
42{
43class StdPyrExp : virtual public StdExpansion3D
44{
45public:
47 const LibUtilities::BasisKey &Bb,
48 const LibUtilities::BasisKey &Bc);
50 const LibUtilities::BasisKey &Bb,
51 const LibUtilities::BasisKey &Bc,
52 NekDouble *coeffs, NekDouble *phys);
53 StdPyrExp() = default;
54 StdPyrExp(const StdPyrExp &T) = default;
55 ~StdPyrExp() override = default;
56
57protected:
58 //---------------------------------------
59 // Differentiation/integration Methods
60 //---------------------------------------
62 const Array<OneD, const NekDouble> &inarray,
64 Array<OneD, NekDouble> &out_d2) override;
66 const int dir, const Array<OneD, const NekDouble> &inarray,
67 Array<OneD, NekDouble> &outarray) override;
69 const Array<OneD, const NekDouble> &inarray,
71 Array<OneD, NekDouble> &out_d2) override;
73 const int dir, const Array<OneD, const NekDouble> &inarray,
74 Array<OneD, NekDouble> &outarray) override;
76 const Array<OneD, const NekDouble> &inarray,
77 Array<OneD, NekDouble> &outarray) override;
78
79 //---------------------------------------
80 // Transforms
81 //---------------------------------------
83 const Array<OneD, const NekDouble> &inarray,
84 Array<OneD, NekDouble> &outarray) override;
86 const Array<OneD, const NekDouble> &inarray,
87 Array<OneD, NekDouble> &outarray) override;
92 const Array<OneD, const NekDouble> &inarray,
94 bool doCheckCollDir0, bool doCheckCollDir1,
95 bool doCheckCollDir2) override;
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 Array<OneD, const NekDouble> &inarray,
108 Array<OneD, NekDouble> &outarray,
109 bool multiplybyweights = true) override;
111 const Array<OneD, const NekDouble> &base0,
112 const Array<OneD, const NekDouble> &base1,
113 const Array<OneD, const NekDouble> &base2,
114 const Array<OneD, const NekDouble> &inarray,
116 bool doCheckCollDir0, bool doCheckCollDir1,
117 bool doCheckCollDir2) override;
119 const int dir, const Array<OneD, const NekDouble> &inarray,
120 Array<OneD, NekDouble> &outarray) override;
122 const int dir, const Array<OneD, const NekDouble> &inarray,
123 Array<OneD, NekDouble> &outarray) override;
124
125 //---------------------------------------
126 // Evaluation functions
127 //---------------------------------------
130 Array<OneD, NekDouble> &eta) override;
133 Array<OneD, NekDouble> &xi) override;
136 Array<OneD, NekDouble> &xi_z) override;
138 const int mode, Array<OneD, NekDouble> &outarray) override;
140 const int fid, int &numModes0, int &numModes1,
141 Orientation faceOrient = eDir1FwdDir1_Dir2FwdDir2) override;
143 const Array<OneD, const NekDouble> &coords, int mode) final;
146 const Array<OneD, const NekDouble> &inarray,
147 std::array<NekDouble, 3> &firstOrderDerivs) override;
148
149 //---------------------------------------
150 // Helper functions
151 //---------------------------------------
152 STD_REGIONS_EXPORT int v_GetNverts() const override;
153 STD_REGIONS_EXPORT int v_GetNedges() const override;
154 STD_REGIONS_EXPORT int v_GetNtraces() const override;
156 STD_REGIONS_EXPORT int v_NumBndryCoeffs() const override;
157 STD_REGIONS_EXPORT int v_NumDGBndryCoeffs() const override;
158 STD_REGIONS_EXPORT int v_GetTraceNcoeffs(const int i) const override;
159 STD_REGIONS_EXPORT int v_GetTraceIntNcoeffs(const int i) const override;
160 STD_REGIONS_EXPORT int v_GetTraceNumPoints(const int i) const override;
161 STD_REGIONS_EXPORT int v_GetEdgeNcoeffs(const int i) const override;
163 const std::vector<unsigned int> &nummodes, int &modes_offset) override;
165 const int i, const int k) const override;
166
167 //---------------------------------------
168 // Mappings
169 //---------------------------------------
171 int localVertexId, bool useCoeffPacking = false) override;
173 Array<OneD, unsigned int> &outarray) override;
175 Array<OneD, unsigned int> &outarray) override;
177 const unsigned int fid, Array<OneD, unsigned int> &maparray) override;
179 const unsigned int fid, Array<OneD, unsigned int> &maparray,
180 Array<OneD, int> &signarray, Orientation faceOrient, int P,
181 int Q) override;
183 const int tid, Array<OneD, unsigned int> &maparray,
184 Array<OneD, int> &signarray,
185 const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2) override;
187 const int tid, Array<OneD, unsigned int> &maparray,
188 Array<OneD, int> &signarray,
189 const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2) override;
190
191 //---------------------------------------
192 // Wrapper functions
193 //---------------------------------------
195 v_GenMatrix(const StdMatrixKey &mkey) override;
197 v_CreateStdMatrix(const StdMatrixKey &mkey) override;
199 Array<OneD, NekDouble> &array, const StdMatrixKey &mkey) override;
200
201 //---------------------------------------
202 // Method for applying sensors
203 //---------------------------------------
205 int numMin, const Array<OneD, const NekDouble> &inarray,
206 Array<OneD, NekDouble> &outarray) override;
207
208private:
209 //---------------------------------------
210 // Private helper functions
211 //---------------------------------------
212 STD_REGIONS_EXPORT int GetMode(int I, int J, int K);
213};
214typedef std::shared_ptr<StdPyrExp> StdPyrExpSharedPtr;
215} // namespace Nektar::StdRegions
216
217#endif // STDPYREXP_H
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdPyrExp.cpp:531
DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey) override
Definition: StdPyrExp.cpp:1875
int v_NumBndryCoeffs() const override
Definition: StdPyrExp.cpp:876
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) final
Definition: StdPyrExp.cpp:795
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdPyrExp.cpp:2134
int v_NumDGBndryCoeffs() const override
Definition: StdPyrExp.cpp:895
void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
Definition: StdPyrExp.cpp:358
void v_GetElmtTraceToTraceMap(const unsigned int fid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation faceOrient, int P, int Q) override
Definition: StdPyrExp.cpp:1315
int v_GetTraceNcoeffs(const int i) const override
Definition: StdPyrExp.cpp:916
void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
Definition: StdPyrExp.cpp:675
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
Definition: StdPyrExp.cpp:1995
~StdPyrExp() override=default
int v_GetEdgeNcoeffs(const int i) const override
Definition: StdPyrExp.cpp:976
void v_BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2) override
Definition: StdPyrExp.cpp:264
int v_GetNtraces() const override
Definition: StdPyrExp.cpp:866
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdPyrExp.cpp:518
void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray) override
Definition: StdPyrExp.cpp:752
StdPyrExp(const StdPyrExp &T)=default
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: StdPyrExp.cpp:407
int v_GetNedges() const override
Definition: StdPyrExp.cpp:861
int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset) override
Definition: StdPyrExp.cpp:1028
int GetMode(int I, int J, int K)
Compute the mode number in the expansion for a particular tensorial combination.
Definition: StdPyrExp.cpp:1909
int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false) override
Definition: StdPyrExp.cpp:1039
int v_GetTraceNumPoints(const int i) const override
Definition: StdPyrExp.cpp:958
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Backward transformation is evaluated at the quadrature points.
Definition: StdPyrExp.cpp:228
void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray) override
Definition: StdPyrExp.cpp:1137
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Inner product of inarray over region with respect to the expansion basis m_base[0]->GetBdata(),...
Definition: StdPyrExp.cpp:393
void v_GetInteriorMap(Array< OneD, unsigned int > &outarray) override
Definition: StdPyrExp.cpp:1098
void v_GetEdgeInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
Definition: StdPyrExp.cpp:1595
void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
Definition: StdPyrExp.cpp:655
DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey) override
Definition: StdPyrExp.cpp:1880
int v_GetNverts() const override
Definition: StdPyrExp.cpp:856
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdPyrExp.cpp:1937
void v_GetTraceInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
Definition: StdPyrExp.cpp:1692
void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdPyrExp.cpp:247
void v_IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2) override
Definition: StdPyrExp.cpp:437
StdPyrExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, NekDouble *coeffs, NekDouble *phys)
void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
Definition: StdPyrExp.cpp:188
const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int k) const override
Definition: StdPyrExp.cpp:994
LibUtilities::ShapeType v_DetShapeType() const override
Definition: StdPyrExp.cpp:871
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
Calculate the derivative of the physical points.
Definition: StdPyrExp.cpp:83
void v_GetTraceNumModes(const int fid, int &numModes0, int &numModes1, Orientation faceOrient=eDir1FwdDir1_Dir2FwdDir2) override
Definition: StdPyrExp.cpp:759
NekDouble v_PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
Definition: StdPyrExp.cpp:711
void v_GetTraceCoeffMap(const unsigned int fid, Array< OneD, unsigned int > &maparray) override
Definition: StdPyrExp.cpp:1198
void v_GetCoords(Array< OneD, NekDouble > &xi_x, Array< OneD, NekDouble > &xi_y, Array< OneD, NekDouble > &xi_z) override
Definition: StdPyrExp.cpp:683
int v_GetTraceIntNcoeffs(const int i) const override
Definition: StdPyrExp.cpp:936
@ P
Monomial polynomials .
Definition: BasisType.h:62
std::shared_ptr< StdPyrExp > StdPyrExpSharedPtr
Definition: StdPyrExp.h:214
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble