Nektar++
QuadExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File QuadExp.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: Expansion for quadrilateral elements.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef QUADEXP_H
37 #define QUADEXP_H
38 
41 #include <LocalRegions/MatrixKey.h>
42 #include <StdRegions/StdQuadExp.h>
45 
46 
47 namespace Nektar
48 {
49  namespace LocalRegions
50  {
51 
52  class QuadExp: virtual public StdRegions::StdQuadExp,
53  virtual public Expansion2D
54  {
55  public:
56  /**
57  * @brief Constructor using BasisKey class for quadrature
58  * points and order definition
59  */
61  const LibUtilities::BasisKey &Ba,
62  const LibUtilities::BasisKey &Bb,
64 
65  LOCAL_REGIONS_EXPORT QuadExp(const QuadExp &T);
66 
68 
69  protected:
70  //-------------------------------
71  // Integration Methods
72  //-------------------------------
74  const Array<OneD, const NekDouble> &inarray);
75 
76  //----------------------------
77  // Differentiation Methods
78  //----------------------------
80  const Array<OneD, const NekDouble> &Lcoord,
81  const Array<OneD, const NekDouble> &physvals);
82  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
83  const Array<OneD, const NekDouble> &inarray,
84  Array<OneD, NekDouble> &out_d0,
85  Array<OneD, NekDouble> &out_d1,
87  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
88  const int dir,
89  const Array<OneD, const NekDouble> &inarray,
90  Array<OneD, NekDouble> &outarray);
92  const Array<OneD, const NekDouble> &inarray,
93  const Array<OneD, const NekDouble> &direction,
95 
96  //---------------------------------------
97  // Transforms
98  //---------------------------------------
99  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
100  const Array<OneD, const NekDouble> &inarray,
101  Array<OneD, NekDouble> &outarray);
102 
104  const Array<OneD, const NekDouble> &inarray,
105  Array<OneD, NekDouble> &outarray);
106 
107  //---------------------------------------
108  // Inner product functions
109  //---------------------------------------
111  const Array<OneD, const NekDouble> &inarray,
112  Array<OneD, NekDouble> &outarray);
114  const int dir,
115  const Array<OneD, const NekDouble> &inarray,
116  Array<OneD, NekDouble> &outarray);
118  const Array<OneD, const NekDouble> &inarray,
119  Array<OneD, NekDouble> &outarray,
120  bool multiplybyweights = true);
122  const Array<OneD, const NekDouble> &inarray,
123  Array<OneD, NekDouble> &outarray);
125  const int dir,
126  const Array<OneD, const NekDouble> &inarray,
127  Array<OneD, NekDouble> &outarray);
129  const int dir,
130  const Array<OneD, const NekDouble> &inarray,
131  Array<OneD, NekDouble> &outarray);
136  Array<OneD, NekDouble> &outarray);
137 
138  //---------------------------------------
139  // Evaluation functions
140  //---------------------------------------
141  LOCAL_REGIONS_EXPORT virtual
143 
144  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
145  const Array<OneD, const NekDouble> &Lcoords,
146  Array<OneD, NekDouble> &coords);
147  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
148  Array<OneD, NekDouble> &coords_1,
149  Array<OneD, NekDouble> &coords_2,
150  Array<OneD, NekDouble> &coords_3);
152  const Array<OneD, const NekDouble> &coord,
153  const Array<OneD, const NekDouble> &physvals);
155  const int edge,
156  const Array<OneD, const NekDouble> &inarray,
157  Array<OneD, NekDouble> &outarray);
159  const int edge,
160  const StdRegions::StdExpansionSharedPtr &EdgeExp,
161  const Array<OneD, const NekDouble> &inarray,
162  Array<OneD, NekDouble> &outarray);
164  const int edge,
165  const StdRegions::StdExpansionSharedPtr &EdgeExp,
166  const Array<OneD, const NekDouble> &inarray,
167  Array<OneD, NekDouble> &outarray,
168  StdRegions::Orientation orient);
170  const int edge,
171  const Array<OneD, const NekDouble> &inarray,
172  Array<OneD, NekDouble> &outarray);
174  const int edge,
175  Array<OneD, NekDouble> &outarray);
177  const int edge);
178 
179 
180  //---------------------------------------
181  // Helper functions
182  //---------------------------------------
183  LOCAL_REGIONS_EXPORT virtual const
185  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
187  const NekDouble *data,
188  const std::vector<unsigned int > &nummodes,
189  const int mode_offset,
190  NekDouble * coeffs);
191  LOCAL_REGIONS_EXPORT virtual
193  LOCAL_REGIONS_EXPORT virtual
195  LOCAL_REGIONS_EXPORT virtual const
197  LOCAL_REGIONS_EXPORT virtual int v_GetNumPoints(const int dir) const;
198 
199 
200  //---------------------------------------
201  // Matrix creation functions
202  //---------------------------------------
204  const StdRegions::StdMatrixKey &mkey);
205 
207  const StdRegions::StdMatrixKey &mkey);
209  const MatrixKey &mkey);
211  const MatrixKey &mkey);
212 
214  const MatrixKey &mkey);
215  LOCAL_REGIONS_EXPORT virtual
217  const MatrixKey &mkey);
218 
220  const MatrixKey &mkey);
221 
222 
223  //---------------------------------------
224  // Operators
225  //---------------------------------------
227  const Array<OneD, const NekDouble> &inarray,
228  Array<OneD, NekDouble> &outarray,
229  const StdRegions::StdMatrixKey &mkey);
231  const Array<OneD, const NekDouble> &inarray,
232  Array<OneD, NekDouble> &outarray,
233  const StdRegions::StdMatrixKey &mkey);
235  const int k1,
236  const int k2,
237  const Array<OneD, const NekDouble> &inarray,
238  Array<OneD, NekDouble> &outarray,
239  const StdRegions::StdMatrixKey &mkey);
241  const int i,
242  const Array<OneD, const NekDouble> &inarray,
243  Array<OneD, NekDouble> &outarray,
244  const StdRegions::StdMatrixKey &mkey);
246  const Array<OneD, const NekDouble> &inarray,
247  Array<OneD, NekDouble> &outarray,
248  const StdRegions::StdMatrixKey &mkey);
250  const Array<OneD, const NekDouble> &inarray,
251  Array<OneD, NekDouble> &outarray,
252  const StdRegions::StdMatrixKey &mkey);
254  const Array<OneD, const NekDouble> &inarray,
255  Array<OneD, NekDouble> &outarray,
256  const StdRegions::StdMatrixKey &mkey);
258  const Array<OneD, const NekDouble> &inarray,
259  Array<OneD, NekDouble> &outarray,
260  const StdRegions::StdMatrixKey &mkey);
262  const Array<OneD, const NekDouble> &inarray,
263  Array<OneD, NekDouble> &outarray,
266  int numMin,
267  const Array<OneD, const NekDouble> &inarray,
268  Array<OneD, NekDouble> &outarray);
270 
272  Array<OneD, NekDouble> &array,
273  const StdRegions::StdMatrixKey &mkey);
274 
275  private:
278 
279  QuadExp();
280 
281  };
282 
283  // type defines for use of QuadExp in a boost vector
284  typedef boost::shared_ptr<QuadExp> QuadExpSharedPtr;
285  typedef std::vector< QuadExpSharedPtr > QuadExpVector;
287  }
288 }
289 
290 #endif
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:2106
virtual StdRegions::Orientation v_GetCartesianEorient(int edge)
Definition: QuadExp.cpp:1500
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2012
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, const Array< OneD, const NekDouble > &Fz, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:576
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 and put into outarray...
Definition: QuadExp.cpp:409
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: QuadExp.cpp:1506
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:286
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: QuadExp.h:277
std::vector< QuadExpSharedPtr >::iterator QuadExpVectorIter
Definition: QuadExp.h:286
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:2006
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: QuadGeom.h:54
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Transform a given function from physical quadrature space to coefficient space.
Definition: QuadExp.cpp:260
virtual int v_GetNumPoints(const int dir) const
Definition: QuadExp.cpp:1513
virtual const SpatialDomains::GeomFactorsSharedPtr & v_GetMetricInfo() const
Definition: QuadExp.cpp:1415
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:1864
virtual void v_GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:808
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &direction, Array< OneD, NekDouble > &out)
Physical derivative along a direction vector.
Definition: QuadExp.cpp:203
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual void v_GetTracePhysVals(const int edge, const StdRegions::StdExpansionSharedPtr &EdgeExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
Definition: QuadExp.cpp:733
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:1994
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2081
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2072
virtual StdRegions::Orientation v_GetEorient(int edge)
Definition: QuadExp.cpp:1494
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: QuadExp.cpp:621
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: QuadExp.cpp:612
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
Definition: QuadExp.cpp:83
virtual void v_IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:535
std::vector< QuadExpSharedPtr > QuadExpVector
Definition: QuadExp.h:285
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: QuadExp.h:276
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: QuadExp.cpp:433
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:2000
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:424
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs)
Unpack data from input file assuming it comes from the same expansion type.
Definition: QuadExp.cpp:1427
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=NullNekDouble1DArray)
Calculate the derivative of the physical points.
Definition: QuadExp.cpp:110
virtual void v_IProductWRTBase_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:463
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:1550
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2021
boost::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:284
double NekDouble
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2062
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2042
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: QuadExp.cpp:605
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: QuadExp.cpp:2156
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:1518
boost::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:479
virtual void v_GetEdgeQFactors(const int edge, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:873
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2052
virtual void v_ComputeLaplacianMetric()
Definition: QuadExp.cpp:2208
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: QuadExp.cpp:644
#define LOCAL_REGIONS_EXPORT
boost::shared_ptr< Basis > BasisSharedPtr
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual void v_ComputeEdgeNormal(const int edge)
Definition: QuadExp.cpp:1133
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:1539
Describes the specification for a Basis.
Definition: Basis.h:50
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2247
virtual void v_GetEdgePhysVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Extract the physical values along edge edge from inarray into outarray following the local edge orien...
Definition: QuadExp.cpp:668
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: QuadExp.cpp:652