Nektar++
StdSegExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: StdSegExp.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 file for Standard Segment Expansions
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_LIBS_STDREGIONS_STDSEGEXP_H
36#define NEKTAR_LIBS_STDREGIONS_STDSEGEXP_H
37
39
40namespace Nektar::StdRegions
41{
42/// Class representing a segment element in reference space
43/// All interface of this class sits in StdExpansion class
44class StdSegExp : virtual public StdExpansion1D
45{
46public:
49 STD_REGIONS_EXPORT ~StdSegExp() override = default;
50
51protected:
52 //----------------------------
53 // Integration Methods
54 //----------------------------
56 v_Integral(const Array<OneD, const NekDouble> &inarray) override;
57
58 //-----------------------------
59 // Differentiation Methods
60 //-----------------------------
62 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,
75 const int dir, const Array<OneD, const NekDouble> &inarray,
76 Array<OneD, NekDouble> &outarray) override;
77
78 //-----------------------------
79 // Transforms
80 //-----------------------------
82 const Array<OneD, const NekDouble> &inarray,
83 Array<OneD, NekDouble> &outarray) override;
85 const Array<OneD, const NekDouble> &inarray,
86 Array<OneD, NekDouble> &outarray) override;
88 const Array<OneD, const NekDouble> &inarray,
89 Array<OneD, NekDouble> &outarray) override;
91 const Array<OneD, const NekDouble> &inarray,
92 Array<OneD, NekDouble> &outarray) override;
93
94 //----------------------------
95 // Inner product functions
96 //----------------------------
98 const Array<OneD, const NekDouble> &inarray,
99 Array<OneD, NekDouble> &outarray) override;
102 const Array<OneD, const NekDouble> &inarray,
103 Array<OneD, NekDouble> &outarray, int coll_check) override;
105 const Array<OneD, const NekDouble> &inarray,
106 Array<OneD, NekDouble> &outarray,
107 bool multiplybyweights = true) override;
109 const int dir, const Array<OneD, const NekDouble> &inarray,
110 Array<OneD, NekDouble> &outarray) override;
112 const int dir, const Array<OneD, const NekDouble> &inarray,
113 Array<OneD, NekDouble> &outarray) override;
114
115 //----------------------------
116 // Evaluations Methods
117 //---------------------------
120 Array<OneD, NekDouble> &eta) override;
123 Array<OneD, NekDouble> &xi) override;
125 const Array<OneD, const NekDouble> &coords, int mode) final;
127 const Array<OneD, NekDouble> &coord,
128 const Array<OneD, const NekDouble> &inarray,
129 std::array<NekDouble, 3> &firstOrderDerivs) override
130 {
131 return StdExpansion1D::BaryTensorDeriv(coord, inarray,
132 firstOrderDerivs);
133 }
136 const Array<OneD, const NekDouble> &inarray,
137 std::array<NekDouble, 3> &firstOrderDerivs,
138 std::array<NekDouble, 6> &secondOrderDerivs) override
139 {
140 return StdExpansion1D::BaryTensorDeriv(coord, inarray, firstOrderDerivs,
141 secondOrderDerivs);
142 }
144 const Array<OneD, const NekDouble> &inarray,
145 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
147 const Array<OneD, const NekDouble> &inarray,
148 Array<OneD, NekDouble> &outarray, const StdMatrixKey &mkey) override;
150 Array<OneD, NekDouble> &array, const StdMatrixKey &mkey) override;
152 Array<OneD, NekDouble> &array, const NekDouble alpha,
153 const NekDouble exponent, const NekDouble cutoff) override;
155 const Array<OneD, const NekDouble> &inarray,
156 Array<OneD, NekDouble> &outarray) override;
158 const int mode, Array<OneD, NekDouble> &outarray) override;
161 Array<OneD, NekDouble> &coords_2) override;
162
163 //----------------------------
164 // Public Mappings
165 //---------------------------
167 Array<OneD, unsigned int> &outarray) override;
169 Array<OneD, unsigned int> &outarray) override;
171 int localVertexId, bool useCoeffPacking = false) override;
172
173 //----------------------------
174 // Helper functions
175 //---------------------------
176 STD_REGIONS_EXPORT int v_GetNverts() const final;
177 STD_REGIONS_EXPORT int v_GetNtraces() const final;
178 STD_REGIONS_EXPORT int v_GetTraceNcoeffs(const int i) const final;
179 STD_REGIONS_EXPORT int v_GetTraceIntNcoeffs(const int i) const final;
180 STD_REGIONS_EXPORT int v_GetTraceNumPoints(const int i) const final;
181 STD_REGIONS_EXPORT int v_NumBndryCoeffs() const override;
182 STD_REGIONS_EXPORT int v_NumDGBndryCoeffs() const override;
185 const std::vector<unsigned int> &nummodes, int &modes_offset) override;
186 STD_REGIONS_EXPORT LibUtilities::ShapeType v_DetShapeType() const override;
187
188 //----------------------------
189 // Wrapper functions
190 //---------------------------
192 v_GenMatrix(const StdMatrixKey &mkey) override;
194 v_CreateStdMatrix(const StdMatrixKey &mkey) override;
195
196 //---------------------------------------
197 // Output interpolation functions
198 //---------------------------------------
200 Array<OneD, int> &conn, bool standard = true) override;
201
202 //---------------------------------------
203 // Operator evaluation functions
204 //---------------------------------------
206 int numMin, const Array<OneD, const NekDouble> &inarray,
207 Array<OneD, NekDouble> &outarray) override;
209 const unsigned int traceid,
210 Array<OneD, unsigned int> &maparray) override;
212 const unsigned int eid, Array<OneD, unsigned int> &maparray,
213 Array<OneD, int> &signarray, Orientation edgeOrient, int P,
214 int Q) override;
216 const int tid, Array<OneD, unsigned int> &maparray,
217 Array<OneD, int> &signarray, Orientation edgeOrient, int P,
218 int Q) override;
219
220private:
221};
222typedef std::shared_ptr<StdSegExp> StdSegExpSharedPtr;
223
224} // namespace Nektar::StdRegions
225
226#endif // STDSEGEXP_H
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
NekDouble BaryTensorDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs)
Class representing a segment element in reference space All interface of this class sits in StdExpans...
Definition: StdSegExp.h:45
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 (this)->m_base[0] and return...
Definition: StdSegExp.cpp:407
int v_NumDGBndryCoeffs() const override
Definition: StdSegExp.cpp:654
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
Definition: StdSegExp.cpp:483
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdSegExp.cpp:194
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey) override
Definition: StdSegExp.cpp:521
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Definition: StdSegExp.cpp:428
void v_GetInteriorMap(Array< OneD, unsigned int > &outarray) override
Definition: StdSegExp.cpp:773
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) final
Definition: StdSegExp.cpp:477
LibUtilities::ShapeType v_DetShapeType() const override
Return Shape of region, using ShapeType enum list. i.e. Segment.
Definition: StdSegExp.cpp:57
StdSegExp(const LibUtilities::BasisKey &Ba)
Constructor using BasisKey class for quadrature points and order definition.
Definition: StdSegExp.cpp:48
int v_NumBndryCoeffs() const override
Definition: StdSegExp.cpp:649
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdMatrixKey &mkey) override
Definition: StdSegExp.cpp:499
void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdSegExp.cpp:339
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdSegExp.cpp:413
void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi) override
Definition: StdSegExp.cpp:460
void v_GetTraceCoeffMap(const unsigned int traceid, Array< OneD, unsigned int > &maparray) override
Get the map of the coefficient location to teh local trace coefficients.
Definition: StdSegExp.cpp:841
int v_GetNverts() const final
Definition: StdSegExp.cpp:624
NekDouble v_PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs, std::array< NekDouble, 6 > &secondOrderDerivs) override
Definition: StdSegExp.h:135
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: StdSegExp.cpp:243
int v_GetTraceNumPoints(const int i) const final
Definition: StdSegExp.cpp:644
void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray) override
Definition: StdSegExp.cpp:466
int v_GetTraceNcoeffs(const int i) const final
Definition: StdSegExp.cpp:634
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray.
Definition: StdSegExp.cpp:121
void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true) override
Definition: StdSegExp.cpp:823
void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2) override
Definition: StdSegExp.cpp:613
int v_GetTraceIntNcoeffs(const int i) const final
Definition: StdSegExp.cpp:639
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrate the physical point list inarray over region and return the value.
Definition: StdSegExp.cpp:92
int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false) override
Definition: StdSegExp.cpp:806
~StdSegExp() override=default
void v_ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff) override
Definition: StdSegExp.cpp:562
DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey) override
Definition: StdSegExp.cpp:735
StdSegExp(const StdSegExp &T)=default
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdSegExp.cpp:420
NekDouble v_PhysEvaluate(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
Definition: StdSegExp.h:126
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdSegExp.cpp:602
void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Backward transform from coefficient space given in inarray and evaluate at the physical quadrature po...
Definition: StdSegExp.cpp:177
int v_GetNtraces() const final
Definition: StdSegExp.cpp:629
void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray) override
Definition: StdSegExp.cpp:744
void v_GetTraceToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient, int P, int Q) override
Definition: StdSegExp.cpp:870
void v_GetElmtTraceToTraceMap(const unsigned int eid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation edgeOrient, int P, int Q) override
Definition: StdSegExp.cpp:889
void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray) override
Definition: StdSegExp.cpp:138
void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta) override
Definition: StdSegExp.cpp:454
bool v_IsBoundaryInteriorExpansion() const override
Definition: StdSegExp.cpp:62
int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset) override
Definition: StdSegExp.cpp:659
DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey) override
Definition: StdSegExp.cpp:672
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: StdSegExp.cpp:265
@ P
Monomial polynomials .
Definition: BasisType.h:62
std::shared_ptr< StdSegExp > StdSegExpSharedPtr
Definition: StdSegExp.h:222
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble
STL namespace.