Nektar++
StdPrismExp.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // File StdPrismExp.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 field for prismatic routines built upon
32 // StdExpansion3D
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_LIB_STDREGIONS_STDPRISMEXP_H
37 #define NEKTAR_LIB_STDREGIONS_STDPRISMEXP_H
38 
41 
42 namespace Nektar
43 {
44 namespace StdRegions
45 {
46 
47 /// Class representing a prismatic element in reference space.
48 class StdPrismExp : virtual public StdExpansion3D
49 {
50 
51 public:
53 
55  const LibUtilities::BasisKey &Bb,
56  const LibUtilities::BasisKey &Bc);
57 
59  const LibUtilities::BasisKey &Bb,
60  const LibUtilities::BasisKey &Bc,
61  NekDouble *coeffs, NekDouble *phys);
62 
64 
66 
67 protected:
68  //---------------------------------------
69  // Differentiation Methods
70  //---------------------------------------
71  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
72  const Array<OneD, const NekDouble> &inarray,
74  Array<OneD, NekDouble> &out_d2);
75  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
76  const int dir, const Array<OneD, const NekDouble> &inarray,
77  Array<OneD, NekDouble> &outarray);
79  const Array<OneD, const NekDouble> &inarray,
81  Array<OneD, NekDouble> &out_d2);
83  const int dir, const Array<OneD, const NekDouble> &inarray,
84  Array<OneD, NekDouble> &outarray);
85 
86  //---------------------------------------
87  // Transforms
88  //---------------------------------------
89  STD_REGIONS_EXPORT virtual void v_BwdTrans(
90  const Array<OneD, const NekDouble> &inarray,
91  Array<OneD, NekDouble> &outarray);
93  const Array<OneD, const NekDouble> &inarray,
94  Array<OneD, NekDouble> &outarray);
96  const Array<OneD, const NekDouble> &base0,
97  const Array<OneD, const NekDouble> &base1,
98  const Array<OneD, const NekDouble> &base2,
99  const Array<OneD, const NekDouble> &inarray,
101  bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2);
102  STD_REGIONS_EXPORT virtual void v_FwdTrans(
103  const Array<OneD, const NekDouble> &inarray,
104  Array<OneD, NekDouble> &outarray);
105 
106  //---------------------------------------
107  // Inner product functions
108  //---------------------------------------
110  const Array<OneD, const NekDouble> &inarray,
111  Array<OneD, NekDouble> &outarray);
113  const Array<OneD, const NekDouble> &inarray,
114  Array<OneD, NekDouble> &outarray);
116  const Array<OneD, const NekDouble> &inarray,
117  Array<OneD, NekDouble> &outarray, bool multiplybyweights = true);
119  const Array<OneD, const NekDouble> &base0,
120  const Array<OneD, const NekDouble> &base1,
121  const Array<OneD, const NekDouble> &base2,
122  const Array<OneD, const NekDouble> &inarray,
124  bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2);
126  const int dir, const Array<OneD, const NekDouble> &inarray,
127  Array<OneD, NekDouble> &outarray);
129  const int dir, const Array<OneD, const NekDouble> &inarray,
130  Array<OneD, NekDouble> &outarray);
132  const int dir, const Array<OneD, const NekDouble> &inarray,
133  Array<OneD, NekDouble> &outarray);
134 
135  //---------------------------------------
136  // Evaluation functions
137  //---------------------------------------
144  Array<OneD, NekDouble> &xi_z);
145  STD_REGIONS_EXPORT virtual void v_FillMode(
146  const int mode, Array<OneD, NekDouble> &outarray);
148  const Array<OneD, const NekDouble> &coords, int mode) final;
150  const int fid, int &numModes0, int &numModes1,
152 
153  //---------------------------------------
154  // Helper functions
155  //---------------------------------------
156  STD_REGIONS_EXPORT virtual int v_GetNverts() const;
157  STD_REGIONS_EXPORT virtual int v_GetNedges() const;
158  STD_REGIONS_EXPORT virtual int v_GetNtraces() const;
160  STD_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
161  STD_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
162  STD_REGIONS_EXPORT virtual int v_GetTraceNcoeffs(const int i) const;
163  STD_REGIONS_EXPORT virtual int v_GetTotalTraceIntNcoeffs() const;
164  STD_REGIONS_EXPORT virtual int v_GetTraceIntNcoeffs(const int i) const;
165  STD_REGIONS_EXPORT virtual int v_GetTraceNumPoints(const int i) const;
166 
167  STD_REGIONS_EXPORT virtual int v_GetEdgeNcoeffs(const int i) const;
168 
170  const int i, const int k) const;
172  const int i, const int j) const;
173 
175  const std::vector<unsigned int> &nummodes, int &modes_offset);
177 
178  //---------------------------------------
179  // Mappings
180  //---------------------------------------
181  STD_REGIONS_EXPORT virtual int v_GetVertexMap(int localVertexId,
182  bool useCoeffPacking = false);
184  Array<OneD, unsigned int> &outarray);
186  Array<OneD, unsigned int> &outarray);
188  const unsigned int fid, Array<OneD, unsigned int> &maparray);
190  const unsigned int fid, Array<OneD, unsigned int> &maparray,
191  Array<OneD, int> &signarray, Orientation faceOrient, int P, int Q);
193  const int tid, Array<OneD, unsigned int> &maparray,
194  Array<OneD, int> &signarray,
195  const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2);
196 
198  const int tid, Array<OneD, unsigned int> &maparray,
199  Array<OneD, int> &signarray,
200  const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2);
201 
202  //---------------------------------------
203  // Wrapper functions
204  //---------------------------------------
206  const StdMatrixKey &mkey);
208  const StdMatrixKey &mkey);
209 
211  const Array<OneD, const NekDouble> &inarray,
212  Array<OneD, NekDouble> &outarray);
213 
215  const StdMatrixKey &mkey);
216 
217  //---------------------------------------
218  // Method for applying sensors
219  //---------------------------------------
221  int numMin, const Array<OneD, const NekDouble> &inarray,
222  Array<OneD, NekDouble> &outarray);
223 
224 private:
225  //---------------------------------------
226  // Private helper functions
227  //---------------------------------------
228  STD_REGIONS_EXPORT int GetMode(int I, int J, int K);
229 };
230 
231 typedef std::shared_ptr<StdPrismExp> StdPrismExpSharedPtr;
232 
233 } // namespace StdRegions
234 } // namespace Nektar
235 
236 #endif // STDPRISMEXP_H
#define STD_REGIONS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:50
Defines a specification for a set of points.
Definition: Points.h:59
Class representing a prismatic element in reference space.
Definition: StdPrismExp.h:49
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual const LibUtilities::BasisKey v_GetTraceBasisKey(const int i, const int k) const
virtual void v_GetTraceInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
virtual LibUtilities::PointsKey v_GetTracePointsKey(const int i, const int j) const
virtual int v_GetTraceNumPoints(const int i) const
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...
virtual int v_GetNedges() const
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the object's default expansion basis; output in ...
virtual void v_IProductWRTBase_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetCoords(Array< OneD, NekDouble > &xi_x, Array< OneD, NekDouble > &xi_y, Array< OneD, NekDouble > &xi_z)
virtual int v_GetTraceIntNcoeffs(const int i) const
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetElmtTraceToTraceMap(const unsigned int fid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, Orientation faceOrient, int P, int Q)
virtual int v_GetTotalTraceIntNcoeffs() const
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdMatrixKey &mkey)
virtual int v_GetTraceNcoeffs(const int i) const
virtual int v_GetNtraces() const
NekDouble v_PhysEvaluateBasis(const Array< OneD, const NekDouble > &coords, int mode) final
virtual void v_BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
virtual void v_GetTraceNumModes(const int fid, int &numModes0, int &numModes1, Orientation faceOrient=eDir1FwdDir1_Dir2FwdDir2)
virtual void v_GetTraceCoeffMap(const unsigned int fid, Array< OneD, unsigned int > &maparray)
virtual int v_GetNverts() const
int GetMode(int I, int J, int K)
Compute the local mode number in the expansion for a particular tensorial combination.
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...
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
virtual int v_GetEdgeNcoeffs(const int i) const
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_StdPhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
virtual int v_NumDGBndryCoeffs() const
StdPrismExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, NekDouble *coeffs, NekDouble *phys)
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
virtual void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
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: StdPrismExp.cpp:94
virtual void v_GetEdgeInteriorToElementMap(const int tid, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, const Orientation traceOrient=eDir1FwdDir1_Dir2FwdDir2)
virtual bool v_IsBoundaryInteriorExpansion()
virtual void v_IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
virtual int v_NumBndryCoeffs() const
virtual void v_LocCollapsedToLocCoord(const Array< OneD, const NekDouble > &eta, Array< OneD, NekDouble > &xi)
virtual LibUtilities::ShapeType v_DetShapeType() const
Return Shape of region, using ShapeType enum list; i.e. prism.
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
std::shared_ptr< StdPrismExp > StdPrismExpSharedPtr
Definition: StdPrismExp.h:231
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:75
double NekDouble