Nektar++
HexExp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: HexExp.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 routines for Hex expansion
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef HEXEXP_H
36#define HEXEXP_H
37
38#include <LibUtilities/BasicUtils/NekManager.hpp> // for NekManager
39
45
47{
48class HexExp : virtual public StdRegions::StdHexExp, virtual public Expansion3D
49{
50public:
52 const LibUtilities::BasisKey &Bb,
53 const LibUtilities::BasisKey &Bc,
55
57
58 LOCAL_REGIONS_EXPORT ~HexExp() override = default;
59
60protected:
61 //------------------------------
62 // Integration Method
63 //------------------------------
65 v_Integral(const Array<OneD, const NekDouble> &inarray) override;
66
67 //-----------------------------
68 // Differentiation Methods
69 //-----------------------------
71 const Array<OneD, const NekDouble> &inarray,
73 Array<OneD, NekDouble> &out_d2) override;
74
76 const int dir, const Array<OneD, const NekDouble> &inarray,
77 Array<OneD, NekDouble> &outarray) override;
78
80 const Array<OneD, const NekDouble> &inarray,
81 const Array<OneD, const NekDouble> &direction,
82 Array<OneD, NekDouble> &out) override;
83
84 //---------------------------------------
85 // Transforms
86 //---------------------------------------
88 const Array<OneD, const NekDouble> &inarray,
89 Array<OneD, NekDouble> &outarray) override;
90
91 //---------------------------------------
92 // Inner product functions
93 //---------------------------------------
95 const Array<OneD, const NekDouble> &inarray,
96 Array<OneD, NekDouble> &outarray) override;
97
99 const Array<OneD, const NekDouble> &inarray,
100 Array<OneD, NekDouble> &outarray,
101 bool multiplybyweights = true) override;
102
104 const int dir, const Array<OneD, const NekDouble> &inarray,
105 Array<OneD, NekDouble> &outarray) override;
106
108 const int dir, const Array<OneD, const NekDouble> &inarray,
109 Array<OneD, NekDouble> &outarray) override;
110
112 const int dir, const Array<OneD, const NekDouble> &inarray,
113 Array<OneD, Array<OneD, NekDouble>> &outarray) override;
114
116 const Array<OneD, const NekDouble> &direction,
117 const Array<OneD, const NekDouble> &inarray,
118 Array<OneD, NekDouble> &outarray) override
119 {
120 IProductWRTDirectionalDerivBase_SumFac(direction, inarray, outarray);
121 }
122
124 const Array<OneD, const NekDouble> &direction,
125 const Array<OneD, const NekDouble> &inarray,
126 Array<OneD, NekDouble> &outarray) override;
127
128 //---------------------------------------
129 // Evaluation functions
130 //---------------------------------------
133 const Array<OneD, const NekDouble> &physvals) override;
134
137 const Array<OneD, const NekDouble> &physvals) override;
138
141 const Array<OneD, const NekDouble> &inarray,
142 std::array<NekDouble, 3> &firstOrderDerivs) override;
143
145 const Array<OneD, const NekDouble> &Lcoords,
146 Array<OneD, NekDouble> &coords) override;
147
150 Array<OneD, NekDouble> &coords_3) override;
151
152 //---------------------------------------
153 // Helper functions
154 //---------------------------------------
156 const override;
157
159 void) const override;
160
162 void) const override;
163
165 const NekDouble *data, const std::vector<unsigned int> &nummodes,
166 const int mode_offset, NekDouble *coeffs,
167 std::vector<LibUtilities::BasisType> &fromType) override;
168
170 const int face, Array<OneD, int> &outarray) override;
171
172 LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int face) override;
173
174 //---------------------------------------
175 // Operator creation functions
176 //---------------------------------------
178 const Array<OneD, const NekDouble> &inarray,
179 Array<OneD, NekDouble> &outarray,
180 const StdRegions::StdMatrixKey &mkey) override;
181
183 const Array<OneD, const NekDouble> &inarray,
184 Array<OneD, NekDouble> &outarray,
185 const StdRegions::StdMatrixKey &mkey) override;
186
188 const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
189 Array<OneD, NekDouble> &outarray,
190 const StdRegions::StdMatrixKey &mkey) override;
191
193 const int i, const Array<OneD, const NekDouble> &inarray,
194 Array<OneD, NekDouble> &outarray,
195 const StdRegions::StdMatrixKey &mkey) override;
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
208 const Array<OneD, const NekDouble> &inarray,
209 Array<OneD, NekDouble> &outarray,
210 const StdRegions::StdMatrixKey &mkey) override;
211
213 int numMin, const Array<OneD, const NekDouble> &inarray,
214 Array<OneD, NekDouble> &outarray) override;
215
218 const StdRegions::StdMatrixKey &mkey) override;
219
220 //---------------------------------------
221 // Matrix creation functions
222 //---------------------------------------
224 v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override;
225
227 v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override;
228
230 v_GetLocMatrix(const MatrixKey &mkey) override;
231
232 LOCAL_REGIONS_EXPORT void v_DropLocMatrix(const MatrixKey &mkey) override;
233
235 v_GetLocStaticCondMatrix(const MatrixKey &mkey) override;
236
238 const MatrixKey &mkey) override;
239
241
242private:
247
249 const Array<OneD, const NekDouble> &inarray,
250 Array<OneD, NekDouble> &outarray, Array<OneD, NekDouble> &wsp) override;
251
254 Array<OneD, Array<OneD, NekDouble>> &d0factors,
255 Array<OneD, Array<OneD, NekDouble>> &d1factors) override;
256};
257
258typedef std::shared_ptr<HexExp> HexExpSharedPtr;
259typedef std::vector<HexExpSharedPtr> HexExpVector;
260} // namespace Nektar::LocalRegions
261
262#endif // HEX_EXP_H
#define LOCAL_REGIONS_EXPORT
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1179
NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray) override
Integrate the physical point list inarray over region.
Definition: HexExp.cpp:101
void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3) override
Definition: HexExp.cpp:645
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: HexExp.h:244
void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1149
void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1156
void v_IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: HexExp.h:115
DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1299
DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1321
~HexExp() override=default
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: HexExp.h:246
void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1193
void v_DropLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: HexExp.cpp:1348
DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey) override
Definition: HexExp.cpp:1333
void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true) override
Calculate the inner product of inarray with respect to the given basis B = base0 * base1 * base2.
Definition: HexExp.cpp:370
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: HexExp.cpp:297
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculates the inner product .
Definition: HexExp.cpp:427
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1269
void v_ComputeTraceNormal(const int face) override
Definition: HexExp.cpp:880
HexExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::HexGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: HexExp.cpp:57
void v_ComputeLaplacianMetric() override
Definition: HexExp.cpp:1426
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: HexExp.cpp:662
void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp) override
Definition: HexExp.cpp:1353
void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2) override
Calculate the derivative of the physical points.
Definition: HexExp.cpp:142
void v_DropLocMatrix(const MatrixKey &mkey) override
Definition: HexExp.cpp:1338
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: HexExp.cpp:400
void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords) override
Retrieves the physical coordinates of a given set of reference coordinates.
Definition: HexExp.cpp:628
NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals) override
This function evaluates the expansion at a single (arbitrary) point of the domain.
Definition: HexExp.cpp:581
void v_IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: HexExp.cpp:514
void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray) override
Definition: HexExp.cpp:472
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: HexExp.cpp:255
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals) override
Definition: HexExp.cpp:573
DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey) override
Definition: HexExp.cpp:1343
void v_GetTracePhysMap(const int face, Array< OneD, int > &outarray) override
Definition: HexExp.cpp:765
LibUtilities::ShapeType v_DetShapeType() const override
Return the region shape using the enum-list of ShapeType.
Definition: HexExp.cpp:657
void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Definition: HexExp.cpp:1211
void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1171
StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const override
Definition: HexExp.cpp:601
StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const override
Definition: HexExp.cpp:608
void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
Calculate the inner product of inarray with respect to the elements basis.
Definition: HexExp.cpp:332
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: HexExp.cpp:1468
void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey) override
Definition: HexExp.cpp:1186
void IProductWRTDirectionalDerivBase_SumFac(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Class representing a hexehedral element in reference space.
Definition: StdHexExp.h:44
std::vector< HexExpSharedPtr > HexExpVector
Definition: HexExp.h:259
std::shared_ptr< HexExp > HexExpSharedPtr
Definition: HexExp.h:258
std::shared_ptr< HexGeom > HexGeomSharedPtr
Definition: HexGeom.h:84
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
StdRegions::ConstFactorMap factors
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:79
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble