Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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);
132 
137  Array<OneD, NekDouble> &outarray);
138 
140  const Array<OneD, const Array<OneD, NekDouble> > &Fvec,
141  Array<OneD, NekDouble> &outarray);
142 
143  //---------------------------------------
144  // Evaluation functions
145  //---------------------------------------
146  LOCAL_REGIONS_EXPORT virtual
148 
149  LOCAL_REGIONS_EXPORT virtual
151 
152  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
153  const Array<OneD, const NekDouble> &Lcoords,
154  Array<OneD, NekDouble> &coords);
155  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
156  Array<OneD, NekDouble> &coords_1,
157  Array<OneD, NekDouble> &coords_2,
158  Array<OneD, NekDouble> &coords_3);
160  const Array<OneD, const NekDouble> &coord,
161  const Array<OneD, const NekDouble> &physvals);
163  const int edge,
164  const Array<OneD, const NekDouble> &inarray,
165  Array<OneD, NekDouble> &outarray);
167  const int edge,
168  const StdRegions::StdExpansionSharedPtr &EdgeExp,
169  const Array<OneD, const NekDouble> &inarray,
170  Array<OneD, NekDouble> &outarray);
172  const int edge,
173  const StdRegions::StdExpansionSharedPtr &EdgeExp,
174  const Array<OneD, const NekDouble> &inarray,
175  Array<OneD, NekDouble> &outarray,
176  StdRegions::Orientation orient);
178  const int edge,
179  const Array<OneD, const NekDouble> &inarray,
180  Array<OneD, NekDouble> &outarray);
182  const int edge,
183  Array<OneD, NekDouble> &outarray);
185  const int edge);
186 
187 
188  //---------------------------------------
189  // Helper functions
190  //---------------------------------------
191  LOCAL_REGIONS_EXPORT virtual const
193  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
195  const NekDouble *data,
196  const std::vector<unsigned int > &nummodes,
197  const int mode_offset,
198  NekDouble * coeffs,
199  std::vector<LibUtilities::BasisType> &fromType);
200  LOCAL_REGIONS_EXPORT virtual
202  LOCAL_REGIONS_EXPORT virtual
204  LOCAL_REGIONS_EXPORT virtual const
207  const int dir) const;
209  const int edge,
210  Array<OneD, int> &outarray);
211 
212 
213  //---------------------------------------
214  // Matrix creation functions
215  //---------------------------------------
217  const StdRegions::StdMatrixKey &mkey);
218 
220  const StdRegions::StdMatrixKey &mkey);
222  const MatrixKey &mkey);
224  const MatrixKey &mkey);
225 
227  const MatrixKey &mkey);
228  LOCAL_REGIONS_EXPORT virtual
230  const MatrixKey &mkey);
231 
233  const MatrixKey &mkey);
234 
235 
236  //---------------------------------------
237  // Operators
238  //---------------------------------------
240  const Array<OneD, const NekDouble> &inarray,
241  Array<OneD, NekDouble> &outarray,
242  const StdRegions::StdMatrixKey &mkey);
244  const Array<OneD, const NekDouble> &inarray,
245  Array<OneD, NekDouble> &outarray,
246  const StdRegions::StdMatrixKey &mkey);
248  const int k1,
249  const int k2,
250  const Array<OneD, const NekDouble> &inarray,
251  Array<OneD, NekDouble> &outarray,
252  const StdRegions::StdMatrixKey &mkey);
254  const int i,
255  const Array<OneD, const NekDouble> &inarray,
256  Array<OneD, NekDouble> &outarray,
257  const StdRegions::StdMatrixKey &mkey);
259  const Array<OneD, const NekDouble> &inarray,
260  Array<OneD, NekDouble> &outarray,
261  const StdRegions::StdMatrixKey &mkey);
263  const Array<OneD, const NekDouble> &inarray,
264  Array<OneD, NekDouble> &outarray,
265  const StdRegions::StdMatrixKey &mkey);
267  const Array<OneD, const NekDouble> &inarray,
268  Array<OneD, NekDouble> &outarray,
269  const StdRegions::StdMatrixKey &mkey);
271  const Array<OneD, const NekDouble> &inarray,
272  Array<OneD, NekDouble> &outarray,
273  const StdRegions::StdMatrixKey &mkey);
275  const Array<OneD, const NekDouble> &inarray,
276  Array<OneD, NekDouble> &outarray,
279  int numMin,
280  const Array<OneD, const NekDouble> &inarray,
281  Array<OneD, NekDouble> &outarray);
283 
285  Array<OneD, NekDouble> &array,
286  const StdRegions::StdMatrixKey &mkey);
287 
288  private:
291 
292  QuadExp();
293 
294  };
295 
296  // type defines for use of QuadExp in a boost vector
297  typedef boost::shared_ptr<QuadExp> QuadExpSharedPtr;
298  typedef std::vector< QuadExpSharedPtr > QuadExpVector;
300  }
301 }
302 
303 #endif
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:2214
virtual StdRegions::Orientation v_GetCartesianEorient(int edge)
Definition: QuadExp.cpp:1608
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2120
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:1614
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:290
std::vector< QuadExpSharedPtr >::iterator QuadExpVectorIter
Definition: QuadExp.h:299
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:2114
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:1621
virtual const SpatialDomains::GeomFactorsSharedPtr & v_GetMetricInfo() const
Definition: QuadExp.cpp:1491
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:1972
virtual void v_GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:827
virtual void v_GetEdgePhysMap(const int edge, Array< OneD, int > &outarray)
Definition: QuadExp.cpp:893
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:752
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:2102
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2189
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2180
virtual StdRegions::Orientation v_GetEorient(int edge)
Definition: QuadExp.cpp:1602
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: QuadExp.cpp:620
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: QuadExp.cpp:640
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: QuadExp.cpp:631
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
Definition: QuadExp.cpp:84
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:298
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: QuadExp.h:289
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:2108
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_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:1658
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2129
boost::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:297
double NekDouble
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2170
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2150
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: QuadExp.cpp:612
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:2264
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:1626
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:941
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2160
virtual void v_ComputeLaplacianMetric()
Definition: QuadExp.cpp:2316
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: QuadExp.cpp:663
#define LOCAL_REGIONS_EXPORT
boost::shared_ptr< Basis > BasisSharedPtr
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual void v_ComputeEdgeNormal(const int edge)
Definition: QuadExp.cpp:1201
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:1647
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:2355
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:687
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:671
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: QuadExp.cpp:1503