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 
41 #include <LocalRegions/MatrixKey.h>
43 #include <StdRegions/StdPrismExp.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
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);
102  const int dir, const Array<OneD, const NekDouble> &inarray,
103  Array<OneD, Array<OneD, NekDouble>> &outarray);
104 
105  //---------------------------------------
106  // Evaluation functions
107  //---------------------------------------
108  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
109  const Array<OneD, const NekDouble> &Lcoords,
110  Array<OneD, NekDouble> &coords);
111 
112  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
113  Array<OneD, NekDouble> &coords_1, Array<OneD, NekDouble> &coords_2,
114  Array<OneD, NekDouble> &coords_3);
115 
117  const Array<OneD, const NekDouble> &Lcoord,
118  const Array<OneD, const NekDouble> &physvals);
119 
121  const Array<OneD, const NekDouble> &coord,
122  const Array<OneD, const NekDouble> &physvals);
123 
124  //---------------------------------------
125  // Helper functions
126  //---------------------------------------
127 
129  void) const;
130 
132  void) const;
133 
134  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
136  const NekDouble *data, const std::vector<unsigned int> &nummodes,
137  const int mode_offset, NekDouble *coeffs,
138  std::vector<LibUtilities::BasisType> &fromType);
139 
141  const int face, Array<OneD, int> &outarray);
142 
143  LOCAL_REGIONS_EXPORT void v_ComputeTraceNormal(const int face);
144 
145  //---------------------------------------
146  // Operator creation functions
147  //---------------------------------------
149  const Array<OneD, const NekDouble> &inarray,
150  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
152  const Array<OneD, const NekDouble> &inarray,
153  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
155  const int k1, const int k2, const Array<OneD, const NekDouble> &inarray,
156  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
158  const Array<OneD, const NekDouble> &inarray,
159  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
161  const Array<OneD, const NekDouble> &inarray,
162  Array<OneD, NekDouble> &outarray, const StdRegions::StdMatrixKey &mkey);
163 
166  //---------------------------------------
167  // Matrix creation functions
168  //---------------------------------------
170  const StdRegions::StdMatrixKey &mkey);
172  const StdRegions::StdMatrixKey &mkey);
174  const MatrixKey &mkey);
176  const MatrixKey &mkey);
178 
181  bool standard = true);
182 
184  virtual void v_NormalTraceDerivFactors(
185  Array<OneD, Array<OneD, NekDouble>> &d0factors,
186  Array<OneD, Array<OneD, NekDouble>> &d1factors,
187  Array<OneD, Array<OneD, NekDouble>> &d2factors);
188 
189 private:
194 
196  const Array<OneD, const NekDouble> &inarray,
198 };
199 
200 typedef std::shared_ptr<PrismExp> PrismExpSharedPtr;
201 typedef std::vector<PrismExpSharedPtr> PrismExpVector;
202 } // namespace LocalRegions
203 } // namespace Nektar
204 
205 #define H_PRISMEXP
206 #endif
#define LOCAL_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:50
void v_ComputeTraceNormal(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:708
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1119
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: PrismExp.cpp:1574
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:997
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1042
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:548
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
Definition: PrismExp.cpp:1328
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:527
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: PrismExp.cpp:519
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:1142
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1012
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:269
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: PrismExp.h:193
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1113
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1073
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: PrismExp.cpp:473
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1108
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: PrismExp.cpp:507
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: PrismExp.cpp:335
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:131
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:990
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:104
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_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: PrismExp.cpp:275
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: PrismExp.cpp:466
virtual void v_AlignVectorToCollapsedDir(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, Array< OneD, NekDouble >> &outarray)
Definition: PrismExp.cpp:386
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
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: PrismExp.cpp:342
virtual void v_GetTracePhysMap(const int face, Array< OneD, int > &outarray)
Definition: PrismExp.cpp:607
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: PrismExp.h:191
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:490
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1096
Class representing a prismatic element in reference space.
Definition: StdPrismExp.h:49
std::shared_ptr< PrismExp > PrismExpSharedPtr
Definition: PrismExp.h:200
std::vector< PrismExpSharedPtr > PrismExpVector
Definition: PrismExp.h:201
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
Definition: PrismGeom.h:84
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