Nektar++
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:
54 const LibUtilities::BasisKey &Ba,
56
58
59 LOCAL_REGIONS_EXPORT ~SegExp() override = default;
60
61protected:
62 //----------------------------
63 // Integration Methods
64 //----------------------------
66 v_Integral(const Array<OneD, const NekDouble> &inarray) override;
67
68 //-----------------------------
69 // Differentiation Methods
70 //-----------------------------
72 const Array<OneD, const NekDouble> &inarray,
76
78 const int dir, const Array<OneD, const NekDouble> &inarray,
79 Array<OneD, NekDouble> &outarray) override;
80
82 const Array<OneD, const NekDouble> &inarray,
83 Array<OneD, NekDouble> &out_ds) override;
84
86 const Array<OneD, const NekDouble> &inarray,
87 Array<OneD, NekDouble> &out_dn) override;
88
89 //-----------------------------
90 // Transforms
91 //-----------------------------
93 const Array<OneD, const NekDouble> &inarray,
94 Array<OneD, NekDouble> &outarray) override;
95
97 const Array<OneD, const NekDouble> &inarray,
98 Array<OneD, NekDouble> &outarray) override;
99
100 //-----------------------------
101 // Inner product functions
102 //-----------------------------
104 const Array<OneD, const NekDouble> &inarray,
105 Array<OneD, NekDouble> &outarray) override;
106
109 const Array<OneD, const NekDouble> &inarray,
110 Array<OneD, NekDouble> &outarray, int coll_check) override;
111
113 const int dir, const Array<OneD, const NekDouble> &inarray,
114 Array<OneD, NekDouble> &outarray) override;
115
119 Array<OneD, NekDouble> &outarray) override;
120
122 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
123 Array<OneD, NekDouble> &outarray) override;
124
125 //-----------------------------
126 // Evaluation functions
127 //-----------------------------
130 const Array<OneD, const NekDouble> &physvals) override;
131
134 const Array<OneD, const NekDouble> &physvals) override;
135
138 const Array<OneD, const NekDouble> &inarray,
139 std::array<NekDouble, 3> &firstOrderDerivs) override;
140
143 const Array<OneD, const NekDouble> &inarray,
144 std::array<NekDouble, 3> &firstOrderDerivs,
145 std::array<NekDouble, 6> &secondOrderDerivs) override;
146
148 const Array<OneD, const NekDouble> &Lcoords,
149 Array<OneD, NekDouble> &coords) override;
150
153 Array<OneD, NekDouble> &coords_3) override;
154
156 const int vertex, const Array<OneD, const NekDouble> &inarray,
157 NekDouble &outarray) override;
158
160 const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp,
161 const Array<OneD, const NekDouble> &inarray,
162 Array<OneD, NekDouble> &outarray,
163 StdRegions::Orientation orient) override;
164
165 LOCAL_REGIONS_EXPORT void v_GetTracePhysMap(const int vertex,
166 Array<OneD, int> &map) override;
167 //-----------------------------
168 // Helper functions
169 //-----------------------------
171 void) const override;
172
174 void) const override;
175
178 Array<OneD, NekDouble> &outarray) override;
179
180 LOCAL_REGIONS_EXPORT int v_NumBndryCoeffs() const override;
181
182 LOCAL_REGIONS_EXPORT int v_NumDGBndryCoeffs() const override;
183
184 LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int vertex) override;
185
187 const NekDouble *data, const std::vector<unsigned int> &nummodes,
188 const int mode_offset, NekDouble *coeffs,
189 std::vector<LibUtilities::BasisType> &fromType) override;
190
192 override;
193
194 //-----------------------------
195 // Operator creation functions
196 //-----------------------------
198 const Array<OneD, const NekDouble> &inarray,
199 Array<OneD, NekDouble> &outarray,
200 const StdRegions::StdMatrixKey &mkey) override;
201
203 const Array<OneD, const NekDouble> &inarray,
204 Array<OneD, NekDouble> &outarray,
205 const StdRegions::StdMatrixKey &mkey) override;
206
207 //-----------------------------
208 // Matrix creation functions
209 //-----------------------------
210
212 v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override;
213
215 CreateMatrix(const MatrixKey &mkey);
216
218 v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override;
219
221 v_GetLocMatrix(const MatrixKey &mkey) override;
222
223 LOCAL_REGIONS_EXPORT void v_DropLocMatrix(const MatrixKey &mkey) override;
224
226 v_GetLocStaticCondMatrix(const MatrixKey &mkey) override;
227
229 const MatrixKey &mkey) override;
230
231private:
236
238 const Array<OneD, NekDouble> &inarray,
239 Array<OneD, NekDouble> &outarray);
240
241 /// \todo Same method exists in ExpList and everyone references
242 /// ExpList::MultiplyByElmtInvMass. Remove this one?
244 const Array<OneD, const NekDouble> &inarray,
245 Array<OneD, NekDouble> &outarray);
246};
247
248typedef std::shared_ptr<SegExp> SegExpSharedPtr;
249typedef std::vector<SegExpSharedPtr> SegExpVector;
250} // namespace Nektar::LocalRegions
251
252#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:873
~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:1077
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition: SegExp.cpp:737
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:684
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:649
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
Definition: SegExp.cpp:585
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:1322
SegExp(const LibUtilities::BasisKey &Ba, const SpatialDomains::Geometry1DSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: SegExp.cpp:55
void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray) override
Definition: SegExp.cpp:551
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1091
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition: SegExp.cpp:731
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:472
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: SegExp.cpp:1292
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:235
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:963
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:763
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:641
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: SegExp.cpp:1062
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:1363
int v_NumBndryCoeffs() const override
Definition: SegExp.cpp:751
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:233
NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals) override
Definition: SegExp.cpp:593
void v_GetTracePhysMap(const int vertex, Array< OneD, int > &map) override
Definition: SegExp.cpp:697
int v_NumDGBndryCoeffs() const override
Definition: SegExp.cpp:756
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: SegExp.cpp:1082
void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: SegExp.cpp:712
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: SegExp.cpp:1067
const Array< OneD, const NekDouble > & v_GetPhysNormals() override
Definition: SegExp.cpp:745
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition: SegExp.cpp:1072
void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Definition: SegExp.cpp:626
void v_ComputeTraceNormal(const int vertex) override
Definition: SegExp.cpp:805
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: SegExp.cpp:525
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:249
std::shared_ptr< SegExp > SegExpSharedPtr
Definition: SegExp.h:248
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:61
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
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