Nektar++
StdPyrExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File StdPyrExp.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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: Header field for pyramidic routines built upon
33 // StdExpansion3D
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_LIBS_STDREGIONS_STDPYREXP_H
38 #define NEKTAR_LIBS_STDREGIONS_STDPYREXP_H
39 
42 #include <boost/tuple/tuple.hpp>
43 
44 namespace Nektar
45 {
46  namespace StdRegions
47  {
48  typedef boost::tuple<
49  unsigned int, unsigned int, unsigned int, unsigned int> Mode;
50 
51  struct cmpop
52  {
53  bool operator()(Mode const &a, Mode const &b) const
54  {
55  if (a.get<0>() < b.get<0>())
56  {
57  return true;
58  }
59  if (a.get<0>() > b.get<0>())
60  {
61  return false;
62  }
63 
64  if (a.get<1>() < b.get<1>())
65  {
66  return true;
67  }
68  if (a.get<1>() > b.get<1>())
69  {
70  return false;
71  }
72 
73  if (a.get<2>() < b.get<2>())
74  {
75  return true;
76  }
77 
78  return false;
79  }
80  };
81 
82  class StdPyrExp : virtual public StdExpansion3D
83  {
84  public:
86 
88  const LibUtilities::BasisKey &Bb,
89  const LibUtilities::BasisKey &Bc);
90 
92  const LibUtilities::BasisKey &Bb,
93  const LibUtilities::BasisKey &Bc,
94  NekDouble *coeffs,
95  NekDouble *phys);
96 
97  STD_REGIONS_EXPORT StdPyrExp(const StdPyrExp &T);
98 
100 
101  STD_REGIONS_EXPORT int GetTetMode(int I, int J, int K);
102 
103  protected:
104  //---------------------------------------
105  // Differentiation/integration Methods
106  //---------------------------------------
107  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
108  const Array<OneD, const NekDouble> &inarray,
109  Array<OneD, NekDouble> &out_d0,
110  Array<OneD, NekDouble> &out_d1,
111  Array<OneD, NekDouble> &out_d2);
112  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
113  const int dir,
114  const Array<OneD, const NekDouble> &inarray,
115  Array<OneD, NekDouble> &outarray);
116  STD_REGIONS_EXPORT virtual void v_StdPhysDeriv(
117  const Array<OneD, const NekDouble> &inarray,
118  Array<OneD, NekDouble> &out_d0,
119  Array<OneD, NekDouble> &out_d1,
120  Array<OneD, NekDouble> &out_d2);
121  STD_REGIONS_EXPORT virtual void v_StdPhysDeriv(
122  const int dir,
123  const Array<OneD, const NekDouble> &inarray,
124  Array<OneD, NekDouble> &outarray);
126  const Array<OneD, const NekDouble> &inarray,
127  Array<OneD, NekDouble> &outarray);
128 
129  //---------------------------------------
130  // Transforms
131  //---------------------------------------
132  STD_REGIONS_EXPORT virtual void v_BwdTrans(
133  const Array<OneD, const NekDouble>& inarray,
134  Array<OneD, NekDouble> &outarray);
136  const Array<OneD, const NekDouble> &inarray,
137  Array<OneD, NekDouble> &outarray);
139  const Array<OneD, const NekDouble> &base0,
140  const Array<OneD, const NekDouble> &base1,
141  const Array<OneD, const NekDouble> &base2,
142  const Array<OneD, const NekDouble> &inarray,
143  Array<OneD, NekDouble> &outarray,
145  bool doCheckCollDir0,
146  bool doCheckCollDir1,
147  bool doCheckCollDir2);
148  STD_REGIONS_EXPORT virtual void v_FwdTrans(
149  const Array<OneD, const NekDouble>& inarray,
150  Array<OneD, NekDouble> &outarray);
151 
152  //---------------------------------------
153  // Inner product functions
154  //---------------------------------------
156  const Array<OneD, const NekDouble> &inarray,
157  Array<OneD, NekDouble> &outarray);
159  const Array<OneD, const NekDouble> &inarray,
160  Array<OneD, NekDouble> &outarray,
161  bool multiplybyweights = true);
163  const Array<OneD, const NekDouble> &base0,
164  const Array<OneD, const NekDouble> &base1,
165  const Array<OneD, const NekDouble> &base2,
166  const Array<OneD, const NekDouble> &inarray,
167  Array<OneD, NekDouble> &outarray,
169  bool doCheckCollDir0,
170  bool doCheckCollDir1,
171  bool doCheckCollDir2);
173  const int dir,
174  const Array<OneD, const NekDouble>& inarray,
175  Array<OneD, NekDouble>& outarray);
177  const int dir,
178  const Array<OneD, const NekDouble>& inarray,
179  Array<OneD, NekDouble>& outarray);
180 
181  //---------------------------------------
182  // Evaluation functions
183  //---------------------------------------
187  STD_REGIONS_EXPORT virtual void v_GetCoords(
188  Array<OneD, NekDouble> & xi_x,
189  Array<OneD, NekDouble> & xi_y,
190  Array<OneD, NekDouble> & xi_z);
191  STD_REGIONS_EXPORT virtual void v_FillMode(
192  const int mode,
193  Array<OneD, NekDouble> &outarray);
194 
195  //---------------------------------------
196  // Helper functions
197  //---------------------------------------
198  STD_REGIONS_EXPORT virtual int v_GetNverts() const;
199  STD_REGIONS_EXPORT virtual int v_GetNedges() const;
200  STD_REGIONS_EXPORT virtual int v_GetNfaces() const;
202  STD_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
203  STD_REGIONS_EXPORT virtual int v_GetEdgeNcoeffs(const int i) const;
204  STD_REGIONS_EXPORT virtual int v_GetFaceNcoeffs(const int i) const;
205  STD_REGIONS_EXPORT virtual int v_GetFaceIntNcoeffs(const int i) const;
206  STD_REGIONS_EXPORT virtual int v_GetFaceNumPoints(const int i) const;
208  const std::vector<unsigned int> &nummodes,
209  int &modes_offset);
211  v_DetFaceBasisKey(const int i, const int k) const;
213  const int i) const;
214 
215  //---------------------------------------
216  // Mappings
217  //---------------------------------------
219  const int fid,
220  const Orientation faceOrient,
221  Array<OneD, unsigned int> &maparray,
222  Array<OneD, int> &signarray,
223  int nummodesA=-1,
224  int nummodesB=-1);
226  int localVertexId,
227  bool useCoeffPacking = false);
229  const int eid,
230  const Orientation edgeOrient,
231  Array<OneD, unsigned int> &maparray,
232  Array<OneD, int> &signarray);
234  const int fid,
235  const Orientation faceOrient,
236  Array<OneD, unsigned int> &maparray,
237  Array<OneD, int> &signarray);
239  Array<OneD, unsigned int> &outarray);
241  Array<OneD, unsigned int> &outarray);
242 
243  //---------------------------------------
244  // Wrapper functions
245  //---------------------------------------
247  const StdMatrixKey &mkey);
249  const StdMatrixKey &mkey);
250 
251  private:
252  //---------------------------------------
253  // Private helper functions
254  //---------------------------------------
255  map<Mode, unsigned int, cmpop> m_map;
256  map<int, map<int, map<int, pair<int, int> > > > m_idxMap;
257  };
258  typedef boost::shared_ptr<StdPyrExp> StdPyrExpSharedPtr;
259  } //end of namespace
260 } //end of namespace
261 
262 #endif //STDPYREXP_H
virtual LibUtilities::ShapeType v_DetShapeType() const
Definition: StdPyrExp.cpp:889
bool operator()(Mode const &a, Mode const &b) const
Definition: StdPyrExp.h:53
virtual void v_GetFaceInteriorMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
Definition: StdPyrExp.cpp:1630
virtual int v_GetEdgeNcoeffs(const int i) const
Definition: StdPyrExp.cpp:914
virtual void v_GetCoords(Array< OneD, NekDouble > &xi_x, Array< OneD, NekDouble > &xi_y, Array< OneD, NekDouble > &xi_z)
Definition: StdPyrExp.cpp:834
void v_MultiplyByStdQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdPyrExp.cpp:1881
virtual const LibUtilities::BasisKey v_DetFaceBasisKey(const int i, const int k) const
Definition: StdPyrExp.cpp:996
virtual void v_FillMode(const int mode, Array< OneD, NekDouble > &outarray)
Definition: StdPyrExp.cpp:862
virtual int v_GetNedges() const
Definition: StdPyrExp.cpp:879
virtual DNekMatSharedPtr v_GenMatrix(const StdMatrixKey &mkey)
Definition: StdPyrExp.cpp:1847
virtual void v_GetEdgeInteriorMap(const int eid, const Orientation edgeOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray)
Definition: StdPyrExp.cpp:1553
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: StdPyrExp.cpp:499
boost::shared_ptr< StdPyrExp > StdPyrExpSharedPtr
Definition: StdPyrExp.h:258
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdPyrExp.cpp:668
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
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: StdPyrExp.cpp:251
virtual int v_GetFaceNcoeffs(const int i) const
Definition: StdPyrExp.cpp:932
map< Mode, unsigned int, cmpop > m_map
Definition: StdPyrExp.h:255
virtual int v_CalcNumberOfCoefficients(const std::vector< unsigned int > &nummodes, int &modes_offset)
Definition: StdPyrExp.cpp:1034
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: StdPyrExp.cpp:550
virtual int v_GetNfaces() const
Definition: StdPyrExp.cpp:884
virtual void v_GetBoundaryMap(Array< OneD, unsigned int > &outarray)
Definition: StdPyrExp.cpp:1823
virtual int v_GetFaceIntNcoeffs(const int i) const
Definition: StdPyrExp.cpp:952
virtual void v_LocCoordToLocCollapsed(const Array< OneD, const NekDouble > &xi, Array< OneD, NekDouble > &eta)
Definition: StdPyrExp.cpp:814
boost::tuple< unsigned int, unsigned int, unsigned int, unsigned int > Mode
Definition: StdPyrExp.h:49
virtual void v_BwdTrans_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdPyrExp.cpp:388
virtual int v_GetVertexMap(int localVertexId, bool useCoeffPacking=false)
Definition: StdPyrExp.cpp:1544
virtual int v_NumBndryCoeffs() const
Definition: StdPyrExp.cpp:894
double NekDouble
virtual void v_GetInteriorMap(Array< OneD, unsigned int > &outarray)
Definition: StdPyrExp.cpp:1795
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)
Definition: StdPyrExp.cpp:579
map< int, map< int, map< int, pair< int, int > > > > m_idxMap
Definition: StdPyrExp.h:256
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)
Definition: StdPyrExp.cpp:400
virtual void v_GetFaceToElementMap(const int fid, const Orientation faceOrient, Array< OneD, unsigned int > &maparray, Array< OneD, int > &signarray, int nummodesA=-1, int nummodesB=-1)
Definition: StdPyrExp.cpp:1069
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdMatrixKey &mkey)
Definition: StdPyrExp.cpp:1852
int GetTetMode(int I, int J, int K)
Number tetrahedral modes in r-direction. Much the same as StdTetExp::GetTetMode but slightly simplifi...
Definition: StdPyrExp.cpp:1862
virtual int v_GetFaceNumPoints(const int i) const
Definition: StdPyrExp.cpp:974
#define STD_REGIONS_EXPORT
virtual LibUtilities::BasisType v_GetEdgeBasisType(const int i) const
Definition: StdPyrExp.cpp:1047
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis m_base[0]->GetBdata(),m_base[1]->GetBdata(), m_base[2]->GetBdata() and return in outarray.
Definition: StdPyrExp.cpp:534
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)
Definition: StdPyrExp.cpp:327
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: StdPyrExp.cpp:682
virtual int v_GetNverts() const
Definition: StdPyrExp.cpp:874
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Backward transformation is evaluated at the quadrature points.
Definition: StdPyrExp.cpp:367
Describes the specification for a Basis.
Definition: Basis.h:50