Nektar++
Loading...
Searching...
No Matches
SegExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: SegExp.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 SegExp routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef SEGEXP_H
36#define SEGEXP_H
37
43
44// #include <fstream>
45
47{
48
49class SegExp : virtual public StdRegions::StdSegExp, virtual public Expansion1D
50{
51
52public:
55
57
58 LOCAL_REGIONS_EXPORT ~SegExp() override = default;
59
60protected:
61 //----------------------------
62 // Integration Methods
63 //----------------------------
65 v_Integral(const Array<OneD, const NekDouble> &inarray) override;
66
67 //-----------------------------
68 // Differentiation Methods
69 //-----------------------------
71 const Array<OneD, const NekDouble> &inarray,
75
77 const int dir, const Array<OneD, const NekDouble> &inarray,
78 Array<OneD, NekDouble> &outarray) override;
79
81 const Array<OneD, const NekDouble> &inarray,
82 Array<OneD, NekDouble> &out_ds) override;
83
85 const Array<OneD, const NekDouble> &inarray,
86 Array<OneD, NekDouble> &out_dn) override;
87
88 //-----------------------------
89 // Transforms
90 //-----------------------------
92 const Array<OneD, const NekDouble> &inarray,
93 Array<OneD, NekDouble> &outarray) override;
94
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;
105
108 const Array<OneD, const NekDouble> &inarray,
109 Array<OneD, NekDouble> &outarray, int coll_check) override;
110
112 const int dir, const Array<OneD, const NekDouble> &inarray,
113 Array<OneD, NekDouble> &outarray) override;
114
118 Array<OneD, NekDouble> &outarray) override;
119
121 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
122 Array<OneD, NekDouble> &outarray) override;
123
124 //-----------------------------
125 // Evaluation functions
126 //-----------------------------
129 const Array<OneD, const NekDouble> &physvals) override;
130
133 const Array<OneD, const NekDouble> &physvals) override;
134
137 const Array<OneD, const NekDouble> &inarray,
138 std::array<NekDouble, 3> &firstOrderDerivs) override;
139
141 const Array<OneD, NekDouble> &coord,
142 const Array<OneD, const NekDouble> &inarray,
143 std::array<NekDouble, 3> &firstOrderDerivs,
144 std::array<NekDouble, 6> &secondOrderDerivs) override;
145
147 const Array<OneD, const NekDouble> &Lcoords,
148 Array<OneD, NekDouble> &coords) override;
149
152 Array<OneD, NekDouble> &coords_3) override;
153
155 const int vertex, const Array<OneD, const NekDouble> &inarray,
156 NekDouble &outarray) override;
157
159 const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp,
160 const Array<OneD, const NekDouble> &inarray,
161 Array<OneD, NekDouble> &outarray,
162 StdRegions::Orientation orient) override;
163
164 LOCAL_REGIONS_EXPORT void v_GetTracePhysMap(const int vertex,
165 Array<OneD, int> &map) override;
166 //-----------------------------
167 // Helper functions
168 //-----------------------------
170 void) const override;
171
173 void) const override;
174
177 Array<OneD, NekDouble> &outarray) override;
178
179 LOCAL_REGIONS_EXPORT int v_NumBndryCoeffs() const override;
180
181 LOCAL_REGIONS_EXPORT int v_NumDGBndryCoeffs() const override;
182
183 LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int vertex) override;
184
186 const NekDouble *data, const std::vector<unsigned int> &nummodes,
187 const int mode_offset, NekDouble *coeffs,
188 std::vector<LibUtilities::BasisType> &fromType) override;
189
191 override;
192
193 //-----------------------------
194 // Operator creation functions
195 //-----------------------------
197 const Array<OneD, const NekDouble> &inarray,
198 Array<OneD, NekDouble> &outarray,
199 const StdRegions::StdMatrixKey &mkey) override;
200
202 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
203 Array<OneD, NekDouble> &outarray,
204 const StdRegions::StdMatrixKey &mkey) override;
205
207 const Array<OneD, const NekDouble> &inarray,
208 Array<OneD, NekDouble> &outarray,
209 const StdRegions::StdMatrixKey &mkey) override;
210
211 //-----------------------------
212 // Matrix creation functions
213 //-----------------------------
214
216 v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override;
217
219 CreateMatrix(const MatrixKey &mkey);
220
222 v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override;
223
225 v_GetLocMatrix(const MatrixKey &mkey) override;
226
227 LOCAL_REGIONS_EXPORT void v_DropLocMatrix(const MatrixKey &mkey) override;
228
230 v_GetLocStaticCondMatrix(const MatrixKey &mkey) override;
231
233 const MatrixKey &mkey) override;
234
235private:
240
242 const Array<OneD, NekDouble> &inarray,
243 Array<OneD, NekDouble> &outarray);
244
245 /// \todo Same method exists in ExpList and everyone references
246 /// ExpList::MultiplyByElmtInvMass. Remove this one?
248 const Array<OneD, const NekDouble> &inarray,
249 Array<OneD, NekDouble> &outarray);
250};
251
252typedef std::shared_ptr<SegExp> SegExpSharedPtr;
253typedef std::vector<SegExpSharedPtr> SegExpVector;
254} // namespace Nektar::LocalRegions
255
256#endif // SEGEXP_H
#define LOCAL_REGIONS_EXPORT
Describes the specification for a Basis.
Definition Basis.h:45
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition SegExp.cpp:901
~SegExp() override=default
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 SegExp.cpp:346
void v_DropLocMatrix(const MatrixKey &mkey) override
Definition SegExp.cpp:1113
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition SegExp.cpp:765
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 SegExp.cpp:712
void v_PhysDeriv_s(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds) override
Evaluate the derivative along a line: . The derivative is calculated performing the product .
Definition SegExp.cpp:201
void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray) override
Definition SegExp.cpp:677
NekDouble v_PhysEvalFirstSecondDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs, std::array< NekDouble, 6 > &secondOrderDerivs) override
Definition SegExp.cpp:641
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
Definition SegExp.cpp:611
void ReverseCoeffsAndSign(const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Reverse the coefficients in a boundary interior expansion this routine is of use when we need the seg...
Definition SegExp.cpp:1488
void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray) override
Definition SegExp.cpp:577
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition SegExp.cpp:1127
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition SegExp.cpp:759
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition SegExp.cpp:369
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)->_Base[0] and return ...
Definition SegExp.cpp:498
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition SegExp.cpp:1458
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition SegExp.h:239
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrate the physical point list inarray over region and return the value.
Definition SegExp.cpp:98
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition SegExp.cpp:999
void v_PhysDeriv_n(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn) override
Evaluate the derivative normal to a line: . The derivative is calculated performing the product .
Definition SegExp.cpp:240
void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType) override
Unpack data from input file assuming it comes from.
Definition SegExp.cpp:791
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 SegExp.cpp:145
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition SegExp.cpp:669
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition SegExp.cpp:1098
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition SegExp.cpp:1529
int v_NumBndryCoeffs() const override
Definition SegExp.cpp:779
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition SegExp.h:237
NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
Definition SegExp.cpp:619
void v_GetTracePhysMap(const int vertex, Array< OneD, int > &map) override
Definition SegExp.cpp:725
int v_NumDGBndryCoeffs() const override
Definition SegExp.cpp:784
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition SegExp.cpp:1118
void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition SegExp.cpp:740
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition SegExp.cpp:1103
const Array< OneD, const NekDouble > & v_GetPhysNormals() override
Definition SegExp.cpp:773
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition SegExp.cpp:1108
void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Definition SegExp.cpp:654
NekDouble v_PhysEvalFirstDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
Definition SegExp.cpp:630
void v_ComputeTraceNormal(const int vertex) override
Definition SegExp.cpp:833
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition SegExp.cpp:551
1D geometry information
Definition Geometry1D.h:49
Class representing a segment element in reference space All interface of this class sits in StdExpans...
Definition StdSegExp.h:45
std::vector< SegExpSharedPtr > SegExpVector
Definition SegExp.h:253
std::shared_ptr< SegExp > SegExpSharedPtr
Definition SegExp.h:252
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
static Array< OneD, NekDouble > NullNekDouble1DArray
std::shared_ptr< DNekMat > DNekMatSharedPtr