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 
38 #include <StdRegions/StdPyrExp.h>
39 #include <SpatialDomains/PyrGeom.h>
40 #include <LocalRegions/MatrixKey.h>
44 
45 namespace Nektar
46 {
47  namespace LocalRegions
48  {
49 
50  class PyrExp: virtual public StdRegions::StdPyrExp,
51  virtual public Expansion3D
52  {
53  public:
54 
55  /** \brief Constructor using BasisKey class for quadrature points and order
56  definition */
58  const LibUtilities::BasisKey &Bb,
59  const LibUtilities::BasisKey &Bc,
61 
62  LOCAL_REGIONS_EXPORT PyrExp(const PyrExp &T);
63 
65 
66  protected:
67  //-------------------------------
68  // Integration Methods
69  //-------------------------------
71  const Array<OneD, const NekDouble>& inarray);
72 
73 
74  //----------------------------
75  // Differentiation Methods
76  //----------------------------
77  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
78  const Array<OneD, const NekDouble>& inarray,
79  Array<OneD, NekDouble>& out_d0,
80  Array<OneD, NekDouble>& out_d1,
81  Array<OneD, NekDouble>& out_d2);
82 
83 
84  //---------------------------------------
85  // Transforms
86  //---------------------------------------
87  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
88  const Array<OneD, const NekDouble> &inarray,
89  Array<OneD, NekDouble> &outarray);
90 
91 
92  //---------------------------------------
93  // Inner product functions
94  //---------------------------------------
96  const Array<OneD, const NekDouble>& inarray,
97  Array<OneD, NekDouble>& outarray);
99  const Array<OneD, const NekDouble>& inarray,
100  Array<OneD, NekDouble>& outarray,
101  bool multiplybyweights = true);
103  const int dir,
104  const Array<OneD, const NekDouble>& inarray,
105  Array<OneD, NekDouble>& outarray);
107  const int dir,
108  const Array<OneD, const NekDouble>& inarray,
109  Array<OneD, NekDouble>& outarray);
110 
111 
112  //---------------------------------------
113  // Evaluation functions
114  //---------------------------------------
115  LOCAL_REGIONS_EXPORT virtual
117 
118  LOCAL_REGIONS_EXPORT virtual
120 
121  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
122  const Array<OneD, const NekDouble> &Lcoords,
123  Array<OneD, NekDouble> &coords);
124 
125  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
126  Array<OneD, NekDouble> &coords_1,
127  Array<OneD, NekDouble> &coords_2,
128  Array<OneD, NekDouble> &coords_3);
129 
131  const NekDouble *data,
132  const std::vector<unsigned int > &nummodes,
133  const int mode_offset,
134  NekDouble * coeffs,
135  std::vector<LibUtilities::BasisType> &fromType);
136 
138  const Array<OneD, const NekDouble> &Lcoord,
139  const Array<OneD, const NekDouble> &physvals);
140 
142  const Array<OneD, const NekDouble>& coord,
143  const Array<OneD, const NekDouble>& physvals);
144 
145 
146  //---------------------------------------
147  // Helper functions
148  //---------------------------------------
149  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
150 
152  const int face,
153  Array<OneD, int> &outarray);
154 
155  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
156 
157 
159  Array<OneD, NekDouble> &array,
160  const StdRegions::StdMatrixKey &mkey);
161 
162  //---------------------------------------
163  // Matrix creation functions
164  //---------------------------------------
166  const StdRegions::StdMatrixKey &mkey);
168  const StdRegions::StdMatrixKey &mkey);
170  const MatrixKey &mkey);
172  const MatrixKey &mkey);
174  const MatrixKey &mkey);
176  const MatrixKey &mkey);
178  const MatrixKey &mkey);
180 
181  private:
184 
186  const Array<OneD, const NekDouble> &inarray,
187  Array<OneD, NekDouble> &outarray,
189  };
190 
191  typedef std::shared_ptr<PyrExp> PyrExpSharedPtr;
192  typedef std::vector<PyrExpSharedPtr> PyrExpVector;
193  } //end of namespace
194 } //end of namespace
195 
196 #endif //PYREXP_H
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: PyrExp.cpp:1231
void v_ComputeFaceNormal(const int face)
Definition: PyrExp.cpp:723
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: PyrExp.h:183
virtual void v_ComputeLaplacianMetric()
Definition: PyrExp.cpp:1343
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: PyrExp.cpp:488
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: PyrExp.cpp:1083
virtual void v_GetFacePhysMap(const int face, Array< OneD, int > &outarray)
Definition: PyrExp.cpp:623
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PyrExp.cpp:1057
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:278
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: PyrExp.cpp:351
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PyrExp.cpp:1036
virtual int v_GetCoordim()
Definition: PyrExp.cpp:618
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: PyrExp.cpp:285
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: PyrExp.cpp:1497
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: PyrExp.cpp:505
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:111
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: PyrExp.cpp:480
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
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:220
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:532
double NekDouble
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:138
std::shared_ptr< PyrExp > PyrExpSharedPtr
Definition: PyrExp.h:191
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: PyrExp.cpp:359
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PyrExp.cpp:1078
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
Definition: PyrGeom.h:80
NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: PyrExp.cpp:592
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: PyrExp.cpp:1002
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: PyrExp.cpp:1068
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PyrExp.cpp:1073
#define LOCAL_REGIONS_EXPORT
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: PyrExp.cpp:523
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:600
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: PyrExp.h:182
std::vector< PyrExpSharedPtr > PyrExpVector
Definition: PyrExp.h:192
Describes the specification for a Basis.
Definition: Basis.h:49
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