Nektar++
StdPrismExp.h
Go to the documentation of this file.
1//////////////////////////////////////////////////////////////////////////////
2//
3// File: StdPrismExp.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 prismatic routines built upon
32// StdExpansion3D
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef NEKTAR_LIB_STDREGIONS_STDPRISMEXP_H
37#define NEKTAR_LIB_STDREGIONS_STDPRISMEXP_H
38
40
41namespace Nektar::StdRegions
42{
43/// Class representing a prismatic element in reference space.
44class StdPrismExp : virtual public StdExpansion3D
45{
46public:
48 const LibUtilities::BasisKey &Bb,
49 const LibUtilities::BasisKey &Bc);
51 const LibUtilities::BasisKey &Bb,
52 const LibUtilities::BasisKey &Bc,
53 NekDouble *coeffs, NekDouble *phys);
55 STD_REGIONS_EXPORT ~StdPrismExp() override = default;
56
57protected:
58 //---------------------------------------
59 // Differentiation 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;
75
76 //---------------------------------------
77 // Transforms
78 //---------------------------------------
80 const Array<OneD, const NekDouble> &inarray,
81 Array<OneD, NekDouble> &outarray) override;
83 const Array<OneD, const NekDouble> &inarray,
84 Array<OneD, NekDouble> &outarray) override;
89 const Array<OneD, const NekDouble> &inarray,
91 bool doCheckCollDir0, bool doCheckCollDir1,
92 bool doCheckCollDir2) override;
94 const Array<OneD, const NekDouble> &inarray,
95 Array<OneD, NekDouble> &outarray) override;
96
97 //---------------------------------------
98 // Inner product functions
99 //---------------------------------------
101 const Array<OneD, const NekDouble> &inarray,
102 Array<OneD, NekDouble> &outarray) override;
104 const Array<OneD, const NekDouble> &inarray,
105 Array<OneD, NekDouble> &outarray,
106 bool multiplybyweights = true) override;
108 const Array<OneD, const NekDouble> &base0,
109 const Array<OneD, const NekDouble> &base1,
110 const Array<OneD, const NekDouble> &base2,
111 const Array<OneD, const NekDouble> &inarray,
113 bool doCheckCollDir0, bool doCheckCollDir1,
114 bool doCheckCollDir2) 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;
133 Array<OneD, NekDouble> &xi_z) override;
135 const int mode, Array<OneD, NekDouble> &outarray) override;
137 const Array<OneD, const NekDouble> &coords, int mode) final;
139 const int fid, int &numModes0, int &numModes1,
140 Orientation faceOrient = eDir1FwdDir1_Dir2FwdDir2) override;
143 const Array<OneD, const NekDouble> &inarray,
144 std::array<NekDouble, 3> &firstOrderDerivs) override;
145
146 //---------------------------------------
147 // Helper functions
148 //---------------------------------------
149 STD_REGIONS_EXPORT int v_GetNverts() const override;
150 STD_REGIONS_EXPORT int v_GetNedges() const override;
151 STD_REGIONS_EXPORT int v_GetNtraces() const override;
153 STD_REGIONS_EXPORT int v_NumBndryCoeffs() const override;
154 STD_REGIONS_EXPORT int v_NumDGBndryCoeffs() const override;
155 STD_REGIONS_EXPORT int v_GetTraceNcoeffs(const int i) const override;
156 STD_REGIONS_EXPORT int v_GetTraceIntNcoeffs(const int i) const override;
157 STD_REGIONS_EXPORT int v_GetTraceNumPoints(const int i) const override;
158 STD_REGIONS_EXPORT int v_GetEdgeNcoeffs(const int i) const override;
160 const int i, const int k) const override;
162 const int i, const int j) const override;
164 const std::vector<unsigned int> &nummodes, int &modes_offset) 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 const Array<OneD, const NekDouble> &inarray,
200 Array<OneD, NekDouble> &outarray) override;
202 Array<OneD, NekDouble> &array, const StdMatrixKey &mkey) override;
203
204 //---------------------------------------
205 // Method for applying sensors
206 //---------------------------------------
208 int numMin, const Array<OneD, const NekDouble> &inarray,
209 Array<OneD, NekDouble> &outarray) override;
210
211private:
212 //---------------------------------------
213 // Private helper functions
214 //---------------------------------------
215 STD_REGIONS_EXPORT int GetMode(int I, int J, int K);
216};
217
218typedef std::shared_ptr<StdPrismExp> StdPrismExpSharedPtr;
219
220} // namespace Nektar::StdRegions
221
222#endif // STDPRISMEXP_H
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
Defines a specification for a set of points.
Definition: Points.h:50
Class representing a prismatic element in reference space.
Definition: StdPrismExp.h:45
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
void v_GetElmtTraceToTraceMap(const unsigned int fid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation faceOrient, int P, int Q) override
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_GetEdgeInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
LibUtilities::PointsKey v_GetTracePointsKey(const int i, const int j) const override
int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false) override
int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset) override
StdPrismExp(const StdPrismExp &T)=default
int v_GetTraceIntNcoeffs(const int i) const override
StdPrismExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
Definition: StdPrismExp.cpp:43
int v_NumBndryCoeffs() const override
void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray) override
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) final
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int k) const override
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
LibUtilities::ShapeType v_DetShapeType() const override
Return Shape of region, using ShapeType enum list; i.e. prism.
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*base2 and put into out...
int v_GetNverts() const override
int v_NumDGBndryCoeffs() const 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) override
Calculate the derivative of the physical points.
Definition: StdPrismExp.cpp:75
void v_GetTraceNumModes(const int fid, int &numModes0, int &numModes1, Orientation faceOrient=eDir1FwdDir1_Dir2FwdDir2) override
void v_GetCoords(Array< OneD, NekDouble > &xi_x, Array< OneD, NekDouble > &xi_y, Array< OneD, NekDouble > &xi_z) override
void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray) override
DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey) override
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
int v_GetNtraces() const override
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
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
int v_GetTraceNcoeffs(const int i) const override
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
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...
StdPrismExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, NekDouble *coeffs, NekDouble *phys)
~StdPrismExp() override=default
NekDouble v_PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
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
int v_GetEdgeNcoeffs(const int i) const override
void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
void v_GetInteriorMap(Array< OneD, unsigned int > &outarray) override
void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
void v_GetTraceCoeffMap(const unsigned int fid, Array< OneD, unsigned int > &maparray) override
void v_GetTraceInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey) override
int v_GetTraceNumPoints(const int i) const override
bool v_IsBoundaryInteriorExpansion() const override
int v_GetNedges() const override
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Inner product of inarray over region with respect to the object's default expansion basis; output in ...
void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
@ P
Monomial polynomials .
Definition: BasisType.h:62
std::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
Definition: StdPrismExp.h:218
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble