Nektar++
StdTriExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: StdTriExp.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 triangle routines built upon StdExpansion2D
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_LIB_STDREGIONS_STDTRIEXP_H
36#define NEKTAR_LIB_STDREGIONS_STDTRIEXP_H
37
39#include <StdRegions/StdSegExp.h> // for StdSegExp, etc
40
41namespace Nektar::StdRegions
42{
43class StdTriExp : virtual public StdExpansion2D
44{
45public:
47 const LibUtilities::BasisKey &Bb);
50 STD_REGIONS_EXPORT ~StdTriExp() 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;
132 const int mode, Array<OneD, NekDouble> &outarray) override;
134 const Array<OneD, const NekDouble> &coords, int mode) final;
135
138 const Array<OneD, const NekDouble> &inarray,
139 std::array<NekDouble, 3> &firstOrderDerivs) override;
140
141 //---------------------------
142 // Helper functions
143 //---------------------------
144 STD_REGIONS_EXPORT int v_GetNverts() const final;
145 STD_REGIONS_EXPORT int v_GetNtraces() const final;
146 STD_REGIONS_EXPORT LibUtilities::ShapeType v_DetShapeType() const final;
147 STD_REGIONS_EXPORT int v_NumBndryCoeffs() const override;
148 STD_REGIONS_EXPORT int v_NumDGBndryCoeffs() const override;
149 STD_REGIONS_EXPORT int v_GetTraceNcoeffs(const int i) const override;
150 STD_REGIONS_EXPORT int v_GetTraceIntNcoeffs(const int i) const override;
151 STD_REGIONS_EXPORT int v_GetTraceNumPoints(const int i) const override;
153 const std::vector<unsigned int> &nummodes, int &modes_offset) override;
155 Array<OneD, NekDouble> &coords_x, Array<OneD, NekDouble> &coords_y,
156 Array<OneD, NekDouble> &coords_z) override;
159 const int i, const int j) const override;
160
161 //--------------------------
162 // Mappings
163 //--------------------------
165 int localVertexId, bool useCoeffPacking = false) override;
167 Array<OneD, unsigned int> &outarray) override;
169 Array<OneD, unsigned int> &outarray) override;
171 const unsigned int traceid,
172 Array<OneD, unsigned int> &maparray) override;
174 const int eid, Array<OneD, unsigned int> &maparray,
175 Array<OneD, int> &signarray,
176 const Orientation edgeOrient = eForwards) override;
177
178 //---------------------------------------
179 // Wrapper functions
180 //---------------------------------------
182 v_GenMatrix(const StdMatrixKey &mkey) override;
184 v_CreateStdMatrix(const StdMatrixKey &mkey) override;
185
186 //---------------------------------------
187 // Operator evaluation functions
188 //---------------------------------------
190 const Array<OneD, const NekDouble> &inarray,
191 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
193 const Array<OneD, const NekDouble> &inarray,
194 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
196 Array<OneD, NekDouble> &array, const StdMatrixKey &mkey) override;
198 int numMin, const Array<OneD, const NekDouble> &inarray,
199 Array<OneD, NekDouble> &outarray) override;
201 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
202 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
204 const int i, const Array<OneD, const NekDouble> &inarray,
205 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
207 const Array<OneD, const NekDouble> &inarray,
208 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
210 const Array<OneD, const NekDouble> &inarray,
211 Array<OneD, NekDouble> &outarray) override;
212
213 //---------------------------------------
214 // Output interpolation functions
215 //---------------------------------------
217 Array<OneD, int> &conn, bool standard = true) override;
218};
219typedef std::shared_ptr<StdTriExp> StdTriExpSharedPtr;
220} // namespace Nektar::StdRegions
221#endif // STDTRIEXP_H
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
Definition: StdTriExp.cpp:1326
LibUtilities::ShapeType v_DetShapeType() const final
Definition: StdTriExp.cpp:727
int v_GetTraceNumPoints(const int i) const override
Definition: StdTriExp.cpp:780
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Backward tranform for triangular elements.
Definition: StdTriExp.cpp:217
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTriExp.cpp:491
NekDouble v_PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
Definition: StdTriExp.cpp:672
void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
Definition: StdTriExp.cpp:596
void v_GetCoords(Array< OneD, NekDouble > &coords_x, Array< OneD, NekDouble > &coords_y, Array< OneD, NekDouble > &coords_z) override
Definition: StdTriExp.cpp:804
int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset) override
Definition: StdTriExp.cpp:794
void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true) override
Definition: StdTriExp.cpp:1541
void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
Definition: StdTriExp.cpp:1304
void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray) override
Definition: StdTriExp.cpp:1062
int v_GetNtraces() const final
Definition: StdTriExp.cpp:722
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: StdTriExp.cpp:193
void v_GetTraceInteriorToElementMap(const int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation edgeOrient=eForwards) override
Definition: StdTriExp.cpp:1149
int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false) override
Definition: StdTriExp.cpp:969
const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int j) const override
Definition: StdTriExp.cpp:830
DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey) override
Definition: StdTriExp.cpp:1295
void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTriExp.cpp:223
DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey) override
Definition: StdTriExp.cpp:1221
~StdTriExp() override=default
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[p]*base1[pq] and put into ou...
Definition: StdTriExp.cpp:420
int v_GetTraceNcoeffs(const int i) const override
Definition: StdTriExp.cpp:752
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: StdTriExp.cpp:106
void v_GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
Definition: StdTriExp.cpp:1094
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: StdTriExp.cpp:233
bool v_IsBoundaryInteriorExpansion() const override
Definition: StdTriExp.cpp:824
void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray) override
Definition: StdTriExp.cpp:603
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTriExp.cpp:1443
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTriExp.cpp:289
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTriExp.cpp:498
StdTriExp(const StdTriExp &T)=default
int v_GetTraceIntNcoeffs(const int i) const override
Definition: StdTriExp.cpp:766
int v_NumDGBndryCoeffs() const override
Definition: StdTriExp.cpp:742
void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
Definition: StdTriExp.cpp:577
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) final
Definition: StdTriExp.cpp:648
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
Definition: StdTriExp.cpp:1334
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrates the specified function over the domain.
Definition: StdTriExp.cpp:58
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: StdTriExp.cpp:273
void v_GetInteriorMap(Array< OneD, unsigned int > &outarray) override
Definition: StdTriExp.cpp:1032
int v_GetNverts() const final
Definition: StdTriExp.cpp:717
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
Definition: StdTriExp.cpp:1311
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
Definition: StdTriExp.cpp:1341
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdTriExp.cpp:1501
int v_NumBndryCoeffs() const override
Definition: StdTriExp.cpp:732
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: StdTriExp.cpp:426
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: StdTriExp.cpp:453
std::shared_ptr< StdTriExp > StdTriExpSharedPtr
Definition: StdTriExp.h:219
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble
STL namespace.