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 // Differentiation Methods
63 //-----------------------------
64
65 //-----------------------------
66 // Transforms
67 //-----------------------------
69 const Array<OneD, const NekDouble> &inarray,
70 Array<OneD, NekDouble> &outarray) override;
71
72 //-----------------------------
73 // Inner product functions
74 //-----------------------------
76 const int dir, const Array<OneD, const NekDouble> &inarray,
77 Array<OneD, NekDouble> &outarray) override;
78
82 Array<OneD, NekDouble> &outarray) override;
83
85 const Array<OneD, const Array<OneD, NekDouble>> &Fvec,
86 Array<OneD, NekDouble> &outarray) override;
87
88 //-----------------------------
89 // Evaluation functions
90 //-----------------------------
93 const Array<OneD, const NekDouble> &inarray,
94 std::array<NekDouble, 3> &firstOrderDerivs) override;
95
97 const Array<OneD, NekDouble> &coord,
98 const Array<OneD, const NekDouble> &inarray,
99 std::array<NekDouble, 3> &firstOrderDerivs,
100 std::array<NekDouble, 6> &secondOrderDerivs) override;
101
103 const Array<OneD, const NekDouble> &Lcoords,
104 Array<OneD, NekDouble> &coords) override;
105
108 Array<OneD, NekDouble> &coords_3) override;
109
111 const int vertex, const Array<OneD, const NekDouble> &inarray,
112 NekDouble &outarray) override;
113
115 const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp,
116 const Array<OneD, const NekDouble> &inarray,
117 Array<OneD, NekDouble> &outarray,
118 StdRegions::Orientation orient) override;
119
120 LOCAL_REGIONS_EXPORT void v_GetTracePhysMap(const int vertex,
121 Array<OneD, int> &map) override;
122 //-----------------------------
123 // Helper functions
124 //-----------------------------
126 void) const override;
127
129 void) const override;
130
133 Array<OneD, NekDouble> &outarray) override;
134
135 LOCAL_REGIONS_EXPORT int v_NumBndryCoeffs() const override;
136
137 LOCAL_REGIONS_EXPORT int v_NumDGBndryCoeffs() const override;
138
139 LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int vertex) override;
140
142 const NekDouble *data, const std::vector<unsigned int> &nummodes,
143 const int mode_offset, NekDouble *coeffs,
144 std::vector<LibUtilities::BasisType> &fromType) override;
145
147 override;
148
149 //-----------------------------
150 // Operator creation functions
151 //-----------------------------
153 const Array<OneD, const NekDouble> &inarray,
154 Array<OneD, NekDouble> &outarray,
155 const StdRegions::StdMatrixKey &mkey) override;
156
158 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
159 Array<OneD, NekDouble> &outarray,
160 const StdRegions::StdMatrixKey &mkey) override;
161
163 const Array<OneD, const NekDouble> &inarray,
164 Array<OneD, NekDouble> &outarray,
165 const StdRegions::StdMatrixKey &mkey) override;
166
167 //-----------------------------
168 // Matrix creation functions
169 //-----------------------------
170
172 v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override;
173
175 CreateMatrix(const MatrixKey &mkey);
176
178 v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override;
179
181 v_GetLocMatrix(const MatrixKey &mkey) override;
182
183 LOCAL_REGIONS_EXPORT void v_DropLocMatrix(const MatrixKey &mkey) override;
184
186 v_GetLocStaticCondMatrix(const MatrixKey &mkey) override;
187
189 const MatrixKey &mkey) override;
190
191private:
196
198 const Array<OneD, NekDouble> &inarray,
199 Array<OneD, NekDouble> &outarray);
200
201 /// \todo Same method exists in ExpList and everyone references
202 /// ExpList::MultiplyByElmtInvMass. Remove this one?
204 const Array<OneD, const NekDouble> &inarray,
205 Array<OneD, NekDouble> &outarray);
206};
207
208typedef std::shared_ptr<SegExp> SegExpSharedPtr;
209typedef std::vector<SegExpSharedPtr> SegExpVector;
210} // namespace Nektar::LocalRegions
211
212#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:519
~SegExp() override=default
void v_DropLocMatrix(const MatrixKey &mkey) override
Definition SegExp.cpp:738
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition SegExp.cpp:386
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:333
void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray) override
Definition SegExp.cpp:298
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:262
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:1113
void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray) override
Definition SegExp.cpp:223
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition SegExp.cpp:752
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition SegExp.cpp:380
void v_FwdTransBndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition SegExp.cpp:81
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition SegExp.cpp:1083
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition SegExp.h:195
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition SegExp.cpp:621
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:412
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition SegExp.cpp:290
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition SegExp.cpp:723
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition SegExp.cpp:1154
int v_NumBndryCoeffs() const override
Definition SegExp.cpp:400
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition SegExp.h:193
void v_GetTracePhysMap(const int vertex, Array< OneD, int > &map) override
Definition SegExp.cpp:346
int v_NumDGBndryCoeffs() const override
Definition SegExp.cpp:405
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition SegExp.cpp:743
void v_SetCoeffsToOrientation(StdRegions::Orientation dir, Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition SegExp.cpp:361
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition SegExp.cpp:728
const Array< OneD, const NekDouble > & v_GetPhysNormals() override
Definition SegExp.cpp:394
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition SegExp.cpp:733
void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Definition SegExp.cpp:275
NekDouble v_PhysEvalFirstDeriv(const Array< OneD, NekDouble > &coord, const Array< OneD, const NekDouble > &inarray, std::array< NekDouble, 3 > &firstOrderDerivs) override
Definition SegExp.cpp:251
void v_ComputeTraceNormal(const int vertex) override
Definition SegExp.cpp:454
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition SegExp.cpp:194
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:209
std::shared_ptr< SegExp > SegExpSharedPtr
Definition SegExp.h:208
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
std::shared_ptr< DNekMat > DNekMatSharedPtr