Nektar++
StdTetExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: StdTetExp.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 tetrahedral routines built upon
32// StdExpansion3D
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef NEKTAR_LIB_STDREGIONS_STDTETEXP_H
37#define NEKTAR_LIB_STDREGIONS_STDTETEXP_H
38
40
41namespace Nektar::StdRegions
42{
43class StdTetExp : 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);
54 STD_REGIONS_EXPORT ~StdTetExp() override = default;
55
57 {
59 }
60
61 /** \brief Single Point Evaluation */
64 const Array<OneD, const NekDouble> &physvals);
65
66protected:
67 //----------------------------
68 // Differentiation Methods
69 //----------------------------
71 const Array<OneD, const NekDouble> &inarray,
73 Array<OneD, NekDouble> &out_dz) override;
75 const int dir, const Array<OneD, const NekDouble> &inarray,
76 Array<OneD, NekDouble> &outarray) override;
78 const Array<OneD, const NekDouble> &inarray,
80 Array<OneD, NekDouble> &out_d2) override;
82 const int dir, const Array<OneD, const NekDouble> &inarray,
83 Array<OneD, NekDouble> &outarray) override;
84
85 //---------------------------------------
86 // Transforms
87 //---------------------------------------
89 const Array<OneD, const NekDouble> &inarray,
90 Array<OneD, NekDouble> &outarray) override;
92 const Array<OneD, const NekDouble> &inarray,
93 Array<OneD, NekDouble> &outarray) override;
98 const Array<OneD, const NekDouble> &inarray,
100 bool doCheckCollDir0, bool doCheckCollDir1,
101 bool doCheckCollDir2) override;
103 const Array<OneD, const NekDouble> &inarray,
104 Array<OneD, NekDouble> &outarray) override;
105
106 //---------------------------------------
107 // Inner product functions
108 //---------------------------------------
110 const Array<OneD, const NekDouble> &inarray,
111 Array<OneD, NekDouble> &outarray) override;
113 const Array<OneD, const NekDouble> &inarray,
114 Array<OneD, NekDouble> &outarray,
115 bool multiplybyweights = true) override;
117 const Array<OneD, const NekDouble> &base0,
118 const Array<OneD, const NekDouble> &base1,
119 const Array<OneD, const NekDouble> &base2,
120 const Array<OneD, const NekDouble> &inarray,
122 bool doCheckCollDir0, bool doCheckCollDir1,
123 bool doCheckCollDir2) override;
125 const int dir, const Array<OneD, const NekDouble> &inarray,
126 Array<OneD, NekDouble> &outarray) override;
128 const int dir, const Array<OneD, const NekDouble> &inarray,
129 Array<OneD, NekDouble> &outarray) override;
130
131 //---------------------------------------
132 // Evaluation functions
133 //---------------------------------------
136 Array<OneD, NekDouble> &eta) override;
139 Array<OneD, NekDouble> &xi) override;
142 Array<OneD, NekDouble> &coords_z) override;
144 const int mode, Array<OneD, NekDouble> &outarray) override;
146 const Array<OneD, const NekDouble> &coords, int mode) final;
147
150 const Array<OneD, const NekDouble> &inarray,
151 std::array<NekDouble, 3> &firstOrderDerivs) override;
153 const int fid, int &numModes0, int &numModes1,
154 Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2) override;
155
156 //---------------------------
157 // Helper functions
158 //---------------------------
159 STD_REGIONS_EXPORT int v_GetNverts() const override;
160 STD_REGIONS_EXPORT int v_GetNedges() const override;
161 STD_REGIONS_EXPORT int v_GetNtraces() const override;
163 STD_REGIONS_EXPORT int v_NumBndryCoeffs() const override;
164 STD_REGIONS_EXPORT int v_NumDGBndryCoeffs() const override;
165 STD_REGIONS_EXPORT int v_GetTraceNcoeffs(const int i) const override;
166 STD_REGIONS_EXPORT int v_GetTraceIntNcoeffs(const int i) const override;
167 STD_REGIONS_EXPORT int v_GetTraceNumPoints(const int i) const override;
168 STD_REGIONS_EXPORT int v_GetEdgeNcoeffs(const int i) const override;
170 const int i, const int j) const override;
172 const std::vector<unsigned int> &nummodes, int &modes_offset) override;
174 const int i, const int k) const override;
176
177 //--------------------------
178 // Mappings
179 //--------------------------
181 int localVertexId, bool useCoeffPacking = false) override;
183 Array<OneD, unsigned int> &outarray) override;
185 Array<OneD, unsigned int> &outarray) override;
187 const unsigned int fid, Array<OneD, unsigned int> &maparray) override;
189 const unsigned int tid, Array<OneD, unsigned int> &maparray,
190 Array<OneD, int> &signarray, Orientation traceOrient = eForwards,
191 int P = -1, int Q = -1) override;
193 const int tid, Array<OneD, unsigned int> &maparray,
194 Array<OneD, int> &signarray,
195 const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2) override;
197 const int tid, Array<OneD, unsigned int> &maparray,
198 Array<OneD, int> &signarray,
199 const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2) override;
200
201 //---------------------------------------
202 // Wrapper functions
203 //---------------------------------------
205 v_GenMatrix(const StdMatrixKey &mkey) override;
207 v_CreateStdMatrix(const StdMatrixKey &mkey) override;
209 const Array<OneD, const NekDouble> &inarray,
210 Array<OneD, NekDouble> &outarray) override;
212 Array<OneD, NekDouble> &array, const StdMatrixKey &mkey) override;
213
214 //---------------------------------------
215 // Method for applying sensors
216 //---------------------------------------
218 int numMin, const Array<OneD, const NekDouble> &inarray,
219 Array<OneD, NekDouble> &outarray) override;
220
221 //---------------------------------------
222 // Output interpolation functions
224 Array<OneD, int> &conn, bool standard = true) override;
225
226private:
227 //---------------------------------------
228 // Private helper functions
229 //---------------------------------------
230 STD_REGIONS_EXPORT int GetMode(const int i, const int j, const int k);
231};
232
233typedef std::shared_ptr<StdTetExp> StdTetExpSharedPtr;
234} // namespace Nektar::StdRegions
235
236#endif // STDTETEXP_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
int v_GetNtraces() const override
Definition: StdTetExp.cpp:965
int v_GetTraceNcoeffs(const int i) const override
Definition: StdTetExp.cpp:1015
void v_GetTraceNumModes(const int fid, int &numModes0, int &numModes1, Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
Definition: StdTetExp.cpp:921
NekDouble v_PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
Definition: StdTetExp.cpp:857
int v_GetTraceIntNcoeffs(const int i) const override
Definition: StdTetExp.cpp:1041
void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:808
void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:416
void v_GetInteriorMap(Array< OneD, unsigned int > &outarray) override
Definition: StdTetExp.cpp:1279
int v_GetNedges() const override
Definition: StdTetExp.cpp:960
int GetMode(const int i, const int j, const int k)
Compute the mode number in the expansion for a particular tensorial combination.
Definition: StdTetExp.cpp:1918
int v_GetEdgeNcoeffs(const int i) const override
Definition: StdTetExp.cpp:1080
bool v_IsBoundaryInteriorExpansion() const override
Definition: StdTetExp.cpp:1188
LibUtilities::PointsKey v_GetTracePointsKey(const int i, const int j) const override
Definition: StdTetExp.cpp:1101
const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int k) const override
Definition: StdTetExp.cpp:1132
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) final
Definition: StdTetExp.cpp:815
StdTetExp(const StdTetExp &T)=default
void v_GetEdgeInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
Definition: StdTetExp.cpp:1580
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:1950
StdTetExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc)
Definition: StdTetExp.cpp:42
int v_GetTraceNumPoints(const int i) const override
Definition: StdTetExp.cpp:1062
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:617
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: StdTetExp.cpp:322
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
Definition: StdTetExp.cpp:2031
DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey) override
Definition: StdTetExp.cpp:1874
void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
Definition: StdTetExp.cpp:768
void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray) override
Definition: StdTetExp.cpp:1318
void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true) override
Definition: StdTetExp.cpp:2233
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:466
int v_NumBndryCoeffs() const override
Definition: StdTetExp.cpp:975
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: StdTetExp.cpp:493
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:266
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:604
NekDouble PhysEvaluate3D(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
Single Point Evaluation.
StdTetExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, NekDouble *coeffs, NekDouble *phys)
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:2173
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: StdTetExp.cpp:226
void v_GetCoords(Array< OneD, NekDouble > &coords_x, Array< OneD, NekDouble > &coords_y, Array< OneD, NekDouble > &coords_z) override
Definition: StdTetExp.cpp:1158
void v_GetTraceCoeffMap(const unsigned int fid, Array< OneD, unsigned int > &maparray) override
Definition: StdTetExp.cpp:1373
void v_GetTraceInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2) override
Definition: StdTetExp.cpp:1695
void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTetExp.cpp:293
void v_GetElmtTraceToTraceMap(const unsigned int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation traceOrient=eForwards, int P=-1, int Q=-1) override
Definition: StdTetExp.cpp:1465
int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false) override
Definition: StdTetExp.cpp:1198
int v_GetNverts() const override
Definition: StdTetExp.cpp:955
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dx, Array< OneD, NekDouble > &out_dy, Array< OneD, NekDouble > &out_dz) override
Calculate the derivative of the physical points.
Definition: StdTetExp.cpp:83
LibUtilities::ShapeType v_DetShapeType() const override
Definition: StdTetExp.cpp:970
void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
Definition: StdTetExp.cpp:800
LibUtilities::ShapeType DetShapeType() const
Definition: StdTetExp.h:56
int v_NumDGBndryCoeffs() const override
Definition: StdTetExp.cpp:994
~StdTetExp() override=default
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: StdTetExp.cpp:523
int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset) override
Definition: StdTetExp.cpp:1121
DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey) override
Definition: StdTetExp.cpp:1786
@ P
Monomial polynomials .
Definition: BasisType.h:62
std::shared_ptr< StdTetExp > StdTetExpSharedPtr
Definition: StdTetExp.h:233
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble