Nektar++
PrismExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File PrismExp.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 PrismExp routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef PRISMEXP_H
36 #define PRISMEXP_H
37 
38 #include <StdRegions/StdPrismExp.h>
40 #include <LocalRegions/MatrixKey.h>
44 
45 namespace Nektar
46 {
47  namespace LocalRegions
48  {
49  class PrismExp : virtual public StdRegions::StdPrismExp,
50  virtual public Expansion3D
51  {
52  public:
53  /// \brief Constructor using BasisKey class for quadrature
54  /// points and order definition
56  const LibUtilities::BasisKey &Bb,
57  const LibUtilities::BasisKey &Bc,
59 
60  LOCAL_REGIONS_EXPORT PrismExp(const PrismExp &T);
61 
63 
64  protected:
65  //-------------------------------
66  // Integration Methods
67  //-------------------------------
69  const Array<OneD, const NekDouble>& inarray);
70 
71 
72  //----------------------------
73  // Differentiation Methods
74  //----------------------------
75  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
76  const Array<OneD, const NekDouble>& inarray,
77  Array<OneD, NekDouble>& out_d0,
78  Array<OneD, NekDouble>& out_d1,
79  Array<OneD, NekDouble>& out_d2);
80 
81 
82  //---------------------------------------
83  // Transforms
84  //---------------------------------------
85  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
86  const Array<OneD, const NekDouble> &inarray,
87  Array<OneD, NekDouble> &outarray);
88 
89 
90  //---------------------------------------
91  // Inner product functions
92  //---------------------------------------
94  const Array<OneD, const NekDouble>& inarray,
95  Array<OneD, NekDouble>& outarray);
97  const Array<OneD, const NekDouble>& inarray,
98  Array<OneD, NekDouble>& outarray,
99  bool multiplybyweights = true);
101  const int dir,
102  const Array<OneD, const NekDouble>& inarray,
103  Array<OneD, NekDouble>& outarray);
105  const int dir,
106  const Array<OneD, const NekDouble>& inarray,
107  Array<OneD, NekDouble>& outarray);
108 
109 
110  //---------------------------------------
111  // Evaluation functions
112  //---------------------------------------
113  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
114  const Array<OneD, const NekDouble> &Lcoords,
115  Array<OneD, NekDouble> &coords);
116 
117  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
118  Array<OneD, NekDouble> &coords_1,
119  Array<OneD, NekDouble> &coords_2,
120  Array<OneD, NekDouble> &coords_3);
121 
123  const Array<OneD, const NekDouble> &Lcoord,
124  const Array<OneD, const NekDouble> &physvals);
125 
127  const Array<OneD, const NekDouble>& coord,
128  const Array<OneD, const NekDouble>& physvals);
129 
130 
131  //---------------------------------------
132  // Helper functions
133  //---------------------------------------
134 
135  LOCAL_REGIONS_EXPORT virtual
137 
138  LOCAL_REGIONS_EXPORT virtual
140 
141  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
143  const NekDouble *data,
144  const std::vector<unsigned int > &nummodes,
145  const int mode_offset,
146  NekDouble * coeffs,
147  std::vector<LibUtilities::BasisType> &fromType);
148 
150  const int face,
151  Array<OneD, int> &outarray);
152 
153  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
154 
155  //---------------------------------------
156  // Operator creation functions
157  //---------------------------------------
159  const Array<OneD, const NekDouble> &inarray,
160  Array<OneD,NekDouble> &outarray,
161  const StdRegions::StdMatrixKey &mkey);
163  const Array<OneD, const NekDouble> &inarray,
164  Array<OneD,NekDouble> &outarray,
165  const StdRegions::StdMatrixKey &mkey);
167  const int k1,
168  const int k2,
169  const Array<OneD, const NekDouble> &inarray,
170  Array<OneD,NekDouble> &outarray,
171  const StdRegions::StdMatrixKey &mkey);
173  const Array<OneD, const NekDouble> &inarray,
174  Array<OneD, NekDouble> &outarray,
175  const StdRegions::StdMatrixKey &mkey);
177  const Array<OneD, const NekDouble> &inarray,
178  Array<OneD,NekDouble> &outarray,
179  const StdRegions::StdMatrixKey &mkey);
180 
182  Array<OneD, NekDouble> &array,
183  const StdRegions::StdMatrixKey &mkey);
184  //---------------------------------------
185  // Matrix creation functions
186  //---------------------------------------
188  const StdRegions::StdMatrixKey &mkey);
190  const StdRegions::StdMatrixKey &mkey);
192  const MatrixKey &mkey);
194  const MatrixKey &mkey);
196  const MatrixKey &mkey);
198  const MatrixKey &mkey);
200  const MatrixKey &mkey);
201 
204  Array<OneD, int> &conn,
205  bool standard = true);
206 
207 
208  private:
213 
215  const Array<OneD, const NekDouble> &inarray,
216  Array<OneD, NekDouble> &outarray,
218  };
219 
220  typedef std::shared_ptr<PrismExp> PrismExpSharedPtr;
221  typedef std::vector<PrismExpSharedPtr> PrismExpVector;
222  } //end of namespace
223 } //end of namespace
224 
225 #define H_PRISMEXP
226 #endif
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1011
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: PrismExp.h:210
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Get the coordinates #coords at the local coordinates #Lcoords.
Definition: PrismExp.cpp:476
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: PrismExp.cpp:494
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: PrismExp.cpp:344
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
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: PrismExp.cpp:272
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1019
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: PrismExp.cpp:537
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
Definition: PrismExp.cpp:1703
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1114
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:985
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
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: PrismExp.cpp:137
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: PrismExp.cpp:217
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: PrismExp.cpp:451
virtual void v_GetFacePhysMap(const int face, Array< OneD, int > &outarray)
Definition: PrismExp.cpp:600
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1124
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over prismatic region and return the value.
Definition: PrismExp.cpp:111
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1098
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: PrismExp.cpp:507
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Calculate the Laplacian multiplication in a matrix-free manner.
Definition: PrismExp.cpp:1547
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: PrismExp.h:212
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1075
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
Definition: NekTypeDefs.hpp:65
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: PrismExp.cpp:279
std::vector< PrismExpSharedPtr > PrismExpVector
Definition: PrismExp.h:221
PrismExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::PrismGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: PrismExp.cpp:49
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1041
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1119
void v_ComputeFaceNormal(const int face)
Get the normals along specficied face Get the face normals interplated to a points0 x points 0 type d...
Definition: PrismExp.cpp:704
Class representing a prismatic element in reference space.
Definition: StdPrismExp.h:48
double NekDouble
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1109
std::shared_ptr< PrismExp > PrismExpSharedPtr
Definition: PrismExp.h:220
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: PrismExp.cpp:515
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: PrismExp.cpp:352
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: PrismExp.cpp:459
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
Definition: PrismGeom.h:88
Used to lookup the create function in NekManager.
Definition: MatrixKey.h:67
#define LOCAL_REGIONS_EXPORT
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:993
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1415
Describes the specification for a Basis.
Definition: Basis.h:49