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:
52 
54 
56  const LibUtilities::BasisKey &Bb,
57  const LibUtilities::BasisKey &Bc);
58 
60  const LibUtilities::BasisKey &Bb,
61  const LibUtilities::BasisKey &Bc,
62  NekDouble *coeffs,
63  NekDouble *phys);
64 
66 
68 
69  protected:
70  //---------------------------------------
71  // Differentiation Methods
72  //---------------------------------------
73  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
74  const Array<OneD, const NekDouble>& inarray,
75  Array<OneD, NekDouble> &out_d0,
76  Array<OneD, NekDouble> &out_d1,
77  Array<OneD, NekDouble> &out_d2);
78  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
79  const int dir,
80  const Array<OneD, const NekDouble>& inarray,
81  Array<OneD, NekDouble>& outarray);
83  const Array<OneD, const NekDouble>& inarray,
84  Array<OneD, NekDouble>& out_d0,
85  Array<OneD, NekDouble>& out_d1,
86  Array<OneD, NekDouble>& out_d2);
88  const int dir,
89  const Array<OneD, const NekDouble>& inarray,
90  Array<OneD, NekDouble>& outarray);
91 
92 
93  //---------------------------------------
94  // Transforms
95  //---------------------------------------
96  STD_REGIONS_EXPORT virtual void v_BwdTrans(
97  const Array<OneD, const NekDouble>& inarray,
98  Array<OneD, NekDouble>& outarray);
100  const Array<OneD, const NekDouble>& inarray,
101  Array<OneD, NekDouble>& outarray);
103  const Array<OneD, const NekDouble> &base0,
104  const Array<OneD, const NekDouble> &base1,
105  const Array<OneD, const NekDouble> &base2,
106  const Array<OneD, const NekDouble> &inarray,
107  Array<OneD, NekDouble> &outarray,
109  bool doCheckCollDir0,
110  bool doCheckCollDir1,
111  bool doCheckCollDir2);
112  STD_REGIONS_EXPORT virtual void v_FwdTrans(
113  const Array<OneD, const NekDouble>& inarray,
114  Array<OneD, NekDouble> &outarray);
115 
116 
117  //---------------------------------------
118  // Inner product functions
119  //---------------------------------------
121  const Array<OneD, const NekDouble>& inarray,
122  Array<OneD, NekDouble>& outarray);
124  const Array<OneD, const NekDouble>& inarray,
125  Array<OneD, NekDouble>& outarray);
127  const Array<OneD, const NekDouble>& inarray,
128  Array<OneD, NekDouble>& outarray,
129  bool multiplybyweights = true);
131  const Array<OneD, const NekDouble>& base0,
132  const Array<OneD, const NekDouble>& base1,
133  const Array<OneD, const NekDouble>& base2,
134  const Array<OneD, const NekDouble>& inarray,
135  Array<OneD, NekDouble> &outarray,
137  bool doCheckCollDir0,
138  bool doCheckCollDir1,
139  bool doCheckCollDir2);
141  const int dir,
142  const Array<OneD, const NekDouble>& inarray,
143  Array<OneD, NekDouble>& outarray);
145  const int dir,
146  const Array<OneD, const NekDouble>& inarray,
147  Array<OneD, NekDouble>& outarray);
149  const int dir,
150  const Array<OneD, const NekDouble>& inarray,
151  Array<OneD, NekDouble>& outarray);
152 
153 
154  //---------------------------------------
155  // Evaluation functions
156  //---------------------------------------
161  const Array<OneD, const NekDouble>& eta,
163  STD_REGIONS_EXPORT virtual void v_GetCoords(
164  Array<OneD, NekDouble> & xi_x,
165  Array<OneD, NekDouble> & xi_y,
166  Array<OneD, NekDouble> & xi_z);
167  STD_REGIONS_EXPORT virtual void v_FillMode(
168  const int mode,
169  Array<OneD, NekDouble> &outarray);
171  const Array<OneD, const NekDouble>& coords,
172  int mode) final;
174  const int fid,
175  int &numModes0,
176  int &numModes1,
178 
179  //---------------------------------------
180  // Helper functions
181  //---------------------------------------
182  STD_REGIONS_EXPORT virtual int v_GetNverts() const;
183  STD_REGIONS_EXPORT virtual int v_GetNedges() const;
184  STD_REGIONS_EXPORT virtual int v_GetNtraces() const;
186  STD_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
187  STD_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
188  STD_REGIONS_EXPORT virtual int v_GetTraceNcoeffs(const int i) const;
189  STD_REGIONS_EXPORT virtual int v_GetTotalTraceIntNcoeffs() const;
190  STD_REGIONS_EXPORT virtual int v_GetTraceIntNcoeffs(const int i) const;
191  STD_REGIONS_EXPORT virtual int v_GetTraceNumPoints(const int i) const;
192 
193  STD_REGIONS_EXPORT virtual int v_GetEdgeNcoeffs(const int i) const;
194 
196  v_GetTraceBasisKey(const int i, const int k) const;
198  v_GetTracePointsKey(const int i, const int j) const;
199 
201  const std::vector<unsigned int> &nummodes,
202  int &modes_offset);
204 
205  //---------------------------------------
206  // Mappings
207  //---------------------------------------
209  int localVertexId,
210  bool useCoeffPacking = false);
212  Array<OneD, unsigned int> &outarray);
214  Array<OneD, unsigned int>& outarray);
216  const int fid,
217  Array<OneD, unsigned int> &maparray,
218  Array<OneD, int> &signarray,
219  Orientation faceOrient,
220  int P,
221  int Q);
223  const int tid,
224  Array<OneD, unsigned int> &maparray,
225  Array<OneD, int> &signarray,
226  const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2);
227 
229  const int tid,
230  Array<OneD, unsigned int> &maparray,
231  Array<OneD, int> &signarray,
232  const Orientation traceOrient = eDir1FwdDir1_Dir2FwdDir2);
233 
234  //---------------------------------------
235  // Wrapper functions
236  //---------------------------------------
238  const StdMatrixKey &mkey);
240  const StdMatrixKey &mkey);
241 
243  const Array<OneD, const NekDouble>& inarray,
244  Array<OneD, NekDouble>& outarray);
245 
247 
248  //---------------------------------------
249  // Method for applying sensors
250  //---------------------------------------
252  int numMin,
253  const Array<OneD, const NekDouble> &inarray,
254  Array<OneD, NekDouble> &outarray);
255 
256  private:
257  //---------------------------------------
258  // Private helper functions
259  //---------------------------------------
260  STD_REGIONS_EXPORT int GetMode(int I, int J, int K);
261  };
262 
263  typedef std::shared_ptr<StdPrismExp> StdPrismExpSharedPtr;
264 
265  } //end of namespace
266 } //end of namespace
267 
268 #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:60
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_GetTraceToElementMap(const 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 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:99
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:263
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
double NekDouble
P
Definition: main.py:133