Nektar++
TriExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: TriExp.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: Expansion for triangular elements.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef TRIEXP_H
36#define TRIEXP_H
37
44
46{
47
48class TriExp : virtual public StdRegions::StdTriExp, virtual public Expansion2D
49{
50
51public:
52 /**
53 * @brief Constructor using BasisKey class for quadrature
54 * points and order definition
55 */
59
61
62 LOCAL_REGIONS_EXPORT ~TriExp() override = default;
63
64protected:
65 //-------------------------------
66 // Integration Methods
67 //-------------------------------
69 v_Integral(const Array<OneD, const NekDouble> &inarray) override;
70
71 //----------------------------
72 // Differentiation Methods
73 //----------------------------
75 const Array<OneD, const NekDouble> &inarray,
79 const int dir, const Array<OneD, const NekDouble> &inarray,
80 Array<OneD, NekDouble> &outarray) override;
82 const Array<OneD, const NekDouble> &inarray,
83 const Array<OneD, const NekDouble> &direction,
84 Array<OneD, NekDouble> &out) override;
85
86 //---------------------------------------
87 // Transforms
88 //---------------------------------------
90 const Array<OneD, const NekDouble> &inarray,
91 Array<OneD, NekDouble> &outarray) override;
93 const Array<OneD, const NekDouble> &inarray,
94 Array<OneD, NekDouble> &outarray) override;
95
96 //---------------------------------------
97 // Inner product functions
98 //---------------------------------------
100 const Array<OneD, const NekDouble> &inarray,
101 Array<OneD, NekDouble> &outarray) override;
103 const int dir, 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 int dir, const Array<OneD, const NekDouble> &inarray,
111 Array<OneD, NekDouble> &outarray) override;
113 const int dir, const Array<OneD, const NekDouble> &inarray,
114 Array<OneD, Array<OneD, NekDouble>> &outarray) override;
116 const Array<OneD, const NekDouble> &direction,
117 const Array<OneD, const NekDouble> &inarray,
118 Array<OneD, NekDouble> &outarray) override;
119
121 const Array<OneD, const NekDouble> &direction,
122 const Array<OneD, const NekDouble> &inarray,
123 Array<OneD, NekDouble> &outarray) override;
124
129 Array<OneD, NekDouble> &outarray) override;
130
132 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
133 Array<OneD, NekDouble> &outarray) override;
134
135 //---------------------------------------
136 // Evaluation functions
137 //---------------------------------------
139 void) const override;
140
142 void) const override;
143
145 const Array<OneD, const NekDouble> &Lcoords,
146 Array<OneD, NekDouble> &coords) override;
149 Array<OneD, NekDouble> &coords_3) override;
152 const Array<OneD, const NekDouble> &physvals) override;
155 const Array<OneD, const NekDouble> &physvals) override;
158 const Array<OneD, const NekDouble> &inarray,
159 std::array<NekDouble, 3> &firstOrderDerivs) override;
161 const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp,
162 const Array<OneD, const NekDouble> &inarray,
163 Array<OneD, NekDouble> &outarray,
164 StdRegions::Orientation orient) override;
166 const int edge, Array<OneD, NekDouble> &outarray) override;
167 LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int edge) override;
168
169 //---------------------------------------
170 // Helper functions
171 //---------------------------------------
173 const NekDouble *data, const std::vector<unsigned int> &nummodes,
174 const int mode_offset, NekDouble *coeffs,
175 std::vector<LibUtilities::BasisType> &fromType) override;
177 int edge) override;
179 const int edge, Array<OneD, int> &outarray) override;
180
181 //---------------------------------------
182 // Matrix creation functions
183 //---------------------------------------
185 v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override;
187 v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override;
189 v_GetLocMatrix(const MatrixKey &mkey) override;
190 LOCAL_REGIONS_EXPORT void v_DropLocMatrix(const MatrixKey &mkey) override;
192 v_GetLocStaticCondMatrix(const MatrixKey &mkey) override;
193
195 const MatrixKey &mkey) override;
196
198 const Array<OneD, const NekDouble> &inarray,
199 Array<OneD, NekDouble> &outarray,
200 const StdRegions::StdMatrixKey &mkey) override;
202 const Array<OneD, const NekDouble> &inarray,
203 Array<OneD, NekDouble> &outarray,
204 const StdRegions::StdMatrixKey &mkey) override;
206 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
207 Array<OneD, NekDouble> &outarray,
208 const StdRegions::StdMatrixKey &mkey) override;
210 const int i, const Array<OneD, const NekDouble> &inarray,
211 Array<OneD, NekDouble> &outarray,
212 const StdRegions::StdMatrixKey &mkey) override;
214 const Array<OneD, const NekDouble> &inarray,
215 Array<OneD, NekDouble> &outarray,
216 const StdRegions::StdMatrixKey &mkey) override;
218 const Array<OneD, const NekDouble> &inarray,
219 Array<OneD, NekDouble> &outarray,
220 const StdRegions::StdMatrixKey &mkey) override;
222 const Array<OneD, const NekDouble> &inarray,
223 Array<OneD, NekDouble> &outarray,
224 const StdRegions::StdMatrixKey &mkey) override;
226 const Array<OneD, const NekDouble> &inarray,
227 Array<OneD, NekDouble> &outarray, Array<OneD, NekDouble> &wsp) override;
229 int numMin, const Array<OneD, const NekDouble> &inarray,
230 Array<OneD, NekDouble> &outarray) override;
231
233
236 const StdRegions::StdMatrixKey &mkey) override;
237
240 Array<OneD, Array<OneD, NekDouble>> &d0factors,
241 Array<OneD, Array<OneD, NekDouble>> &d1factors) override;
242
243private:
248};
249
250typedef std::shared_ptr<TriExp> TriExpSharedPtr;
251typedef std::vector<TriExpSharedPtr> TriExpVector;
252} // namespace Nektar::LocalRegions
253
254#endif
#define LOCAL_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: TriExp.cpp:432
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TriExp.h:245
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition: TriExp.cpp:641
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1147
void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1125
NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
This function evaluates the expansion at a single (arbitrary) point of the domain.
Definition: TriExp.cpp:696
~TriExp() override=default
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: TriExp.cpp:398
void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Definition: TriExp.cpp:463
void v_DropLocMatrix(const MatrixKey &mkey) override
Definition: TriExp.cpp:1088
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: TriExp.cpp:405
void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
Definition: TriExp.cpp:1154
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: TriExp.cpp:676
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: TriExp.cpp:1093
void v_GetTracePhysMap(const int edge, Array< OneD, int > &outarray) override
Definition: TriExp.cpp:783
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1073
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TriExp.h:247
void v_IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: TriExp.cpp:528
void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &out) override
Physical derivative along a direction vector.
Definition: TriExp.cpp:184
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition: TriExp.cpp:648
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1110
void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Definition: TriExp.cpp:659
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition: TriExp.cpp:1083
StdRegions::Orientation v_GetTraceOrient(int edge) override
Definition: TriExp.cpp:1046
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
Definition: TriExp.cpp:688
void v_ComputeTraceNormal(const int edge) override
Definition: TriExp.cpp:818
void v_GetTracePhysVals(const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient) override
Definition: TriExp.cpp:717
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1051
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: TriExp.cpp:1098
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: TriExp.cpp:392
void v_GetTraceQFactors(const int edge, Array< OneD, NekDouble > &outarray) override
Definition: TriExp.cpp:776
void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1133
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: TriExp.cpp:265
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: TriExp.cpp:1366
void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
Definition: TriExp.cpp:1008
void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1103
void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble > > &factors, Array< OneD, Array< OneD, NekDouble > > &d0factors, Array< OneD, Array< OneD, NekDouble > > &d1factors) override
: This method gets all of the factors which are required as part of the Gradient Jump Penalty stabili...
Definition: TriExp.cpp:1454
void v_IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Directinoal Derivative in the modal space in the dir direction of varcoeffs.
Definition: TriExp.cpp:540
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1422
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: TriExp.cpp:94
void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray) override
Definition: TriExp.cpp:606
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: TriExp.cpp:249
void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: TriExp.cpp:1140
TriExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const SpatialDomains::Geometry2DSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: TriExp.cpp:45
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrates the specified function over the domain.
Definition: TriExp.cpp:71
void v_ComputeLaplacianMetric() override
Definition: TriExp.cpp:1210
std::vector< TriExpSharedPtr > TriExpVector
Definition: TriExp.h:251
std::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:250
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:62
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
StdRegions::ConstFactorMap factors
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble