Nektar++
PyrExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File PyrExp.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 PyrExp routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef PYREXP_H
36 #define PYREXP_H
37 
41 #include <LocalRegions/MatrixKey.h>
42 #include <SpatialDomains/PyrGeom.h>
43 #include <StdRegions/StdPyrExp.h>
44 
45 namespace Nektar
46 {
47 namespace LocalRegions
48 {
49 
50 class PyrExp : virtual public StdRegions::StdPyrExp, virtual public Expansion3D
51 {
52 public:
53  /** \brief Constructor using BasisKey class for quadrature points and order
54  definition */
56  const LibUtilities::BasisKey &Bb,
57  const LibUtilities::BasisKey &Bc,
59 
61 
63 
64 protected:
65  //-------------------------------
66  // Integration Methods
67  //-------------------------------
69  const Array<OneD, const NekDouble> &inarray);
70 
71  //----------------------------
72  // Differentiation Methods
73  //----------------------------
74  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
75  const Array<OneD, const NekDouble> &inarray,
77  Array<OneD, NekDouble> &out_d2);
78 
79  //---------------------------------------
80  // Transforms
81  //---------------------------------------
82  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
83  const Array<OneD, const NekDouble> &inarray,
84  Array<OneD, NekDouble> &outarray);
85 
86  //---------------------------------------
87  // Inner product functions
88  //---------------------------------------
90  const Array<OneD, const NekDouble> &inarray,
91  Array<OneD, NekDouble> &outarray);
93  const Array<OneD, const NekDouble> &inarray,
94  Array<OneD, NekDouble> &outarray, bool multiplybyweights = true);
96  const int dir, const Array<OneD, const NekDouble> &inarray,
97  Array<OneD, NekDouble> &outarray);
99  const int dir, const Array<OneD, const NekDouble> &inarray,
100  Array<OneD, NekDouble> &outarray);
101 
103  const int dir, const Array<OneD, const NekDouble> &inarray,
104  Array<OneD, Array<OneD, NekDouble>> &outarray);
105 
106  //---------------------------------------
107  // Evaluation functions
108  //---------------------------------------
110  void) const;
111 
113  void) const;
114 
115  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
116  const Array<OneD, const NekDouble> &Lcoords,
117  Array<OneD, NekDouble> &coords);
118 
119  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
120  Array<OneD, NekDouble> &coords_1, Array<OneD, NekDouble> &coords_2,
121  Array<OneD, NekDouble> &coords_3);
122 
124  const NekDouble *data, const std::vector<unsigned int> &nummodes,
125  const int mode_offset, NekDouble *coeffs,
126  std::vector<LibUtilities::BasisType> &fromType);
127 
130  const Array<OneD, const NekDouble> &physvals);
131 
133  const Array<OneD, const NekDouble> &coord,
134  const Array<OneD, const NekDouble> &physvals);
135 
136  //---------------------------------------
137  // Helper functions
138  //---------------------------------------
139  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
140 
142  const int face, Array<OneD, int> &outarray);
143 
144  LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int face);
145 
148 
149  //---------------------------------------
150  // Matrix creation functions
151  //---------------------------------------
153  const StdRegions::StdMatrixKey &mkey);
155  const StdRegions::StdMatrixKey &mkey);
157  const MatrixKey &mkey);
159  const MatrixKey &mkey);
163  Array<OneD, Array<OneD, NekDouble>> &d0factors,
164  Array<OneD, Array<OneD, NekDouble>> &d1factors,
165  Array<OneD, Array<OneD, NekDouble>> &d2factors);
166 
167 private:
172 
174  const Array<OneD, const NekDouble> &inarray,
176 };
177 
178 typedef std::shared_ptr<PyrExp> PyrExpSharedPtr;
179 typedef std::vector<PyrExpSharedPtr> PyrExpVector;
180 } // namespace LocalRegions
181 } // namespace Nektar
182 
183 #endif // PYREXP_H
#define LOCAL_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:50
virtual int v_GetCoordim()
Definition: PyrExp.cpp:627
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: PyrExp.cpp:506
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PyrExp.cpp:1044
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: PyrExp.h:169
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: PyrExp.cpp:1013
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: PyrExp.cpp:1076
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PyrExp.cpp:1086
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
Calculate the derivative of the physical points.
Definition: PyrExp.cpp:128
virtual void v_GetTracePhysMap(const int face, Array< OneD, int > &outarray)
Definition: PyrExp.cpp:632
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PyrExp.cpp:1065
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
Definition: PyrExp.cpp:282
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: PyrExp.cpp:355
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
Definition: PyrExp.cpp:610
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: PyrExp.h:171
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: PyrExp.cpp:602
void v_ComputeTraceNormal(const int face)
Definition: PyrExp.cpp:730
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: PyrExp.cpp:540
virtual void v_ComputeLaplacianMetric()
Definition: PyrExp.cpp:1091
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: PyrExp.cpp:499
PyrExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::PyrGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: PyrExp.cpp:45
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PyrExp.cpp:1081
virtual void v_NormalTraceDerivFactors(Array< OneD, Array< OneD, NekDouble >> &d0factors, Array< OneD, Array< OneD, NekDouble >> &d1factors, Array< OneD, Array< OneD, NekDouble >> &d2factors)
: This method gets all of the factors which are required as part of the Gradient Jump Penalty stabili...
Definition: PyrExp.cpp:1354
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: PyrExp.cpp:523
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over pyramidic region and return the value.
Definition: PyrExp.cpp:100
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
Definition: PyrExp.cpp:227
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
Definition: PyrExp.cpp:547
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: PyrExp.cpp:348
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: PyrExp.cpp:288
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: PyrExp.cpp:1271
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: PyrExp.cpp:400
std::vector< PyrExpSharedPtr > PyrExpVector
Definition: PyrExp.h:179
std::shared_ptr< PyrExp > PyrExpSharedPtr
Definition: PyrExp.h:178
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
Definition: PyrGeom.h:77
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
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