Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 void v_GetCoord(
150  const Array<OneD, const NekDouble> &Lcoords,
151  Array<OneD, NekDouble> &coords);
152  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
153  Array<OneD, NekDouble> &coords_1,
154  Array<OneD, NekDouble> &coords_2,
155  Array<OneD, NekDouble> &coords_3);
157  const Array<OneD, const NekDouble> &coord,
158  const Array<OneD, const NekDouble> &physvals);
160  const int edge,
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);
169  const int edge,
170  const StdRegions::StdExpansionSharedPtr &EdgeExp,
171  const Array<OneD, const NekDouble> &inarray,
172  Array<OneD, NekDouble> &outarray,
173  StdRegions::Orientation orient);
175  const int edge,
176  const Array<OneD, const NekDouble> &inarray,
177  Array<OneD, NekDouble> &outarray);
179  const int edge,
180  Array<OneD, NekDouble> &outarray);
182  const int edge);
183 
184 
185  //---------------------------------------
186  // Helper functions
187  //---------------------------------------
188  LOCAL_REGIONS_EXPORT virtual const
190  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
192  const NekDouble *data,
193  const std::vector<unsigned int > &nummodes,
194  const int mode_offset,
195  NekDouble * coeffs);
196  LOCAL_REGIONS_EXPORT virtual
198  LOCAL_REGIONS_EXPORT virtual
200  LOCAL_REGIONS_EXPORT virtual const
203  const int dir) const;
205  const int edge,
206  Array<OneD, int> &outarray);
207 
208 
209  //---------------------------------------
210  // Matrix creation functions
211  //---------------------------------------
213  const StdRegions::StdMatrixKey &mkey);
214 
216  const StdRegions::StdMatrixKey &mkey);
218  const MatrixKey &mkey);
220  const MatrixKey &mkey);
221 
223  const MatrixKey &mkey);
224  LOCAL_REGIONS_EXPORT virtual
226  const MatrixKey &mkey);
227 
229  const MatrixKey &mkey);
230 
231 
232  //---------------------------------------
233  // Operators
234  //---------------------------------------
236  const Array<OneD, const NekDouble> &inarray,
237  Array<OneD, NekDouble> &outarray,
238  const StdRegions::StdMatrixKey &mkey);
240  const Array<OneD, const NekDouble> &inarray,
241  Array<OneD, NekDouble> &outarray,
242  const StdRegions::StdMatrixKey &mkey);
244  const int k1,
245  const int k2,
246  const Array<OneD, const NekDouble> &inarray,
247  Array<OneD, NekDouble> &outarray,
248  const StdRegions::StdMatrixKey &mkey);
250  const int i,
251  const Array<OneD, const NekDouble> &inarray,
252  Array<OneD, NekDouble> &outarray,
253  const StdRegions::StdMatrixKey &mkey);
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,
275  int numMin,
276  const Array<OneD, const NekDouble> &inarray,
277  Array<OneD, NekDouble> &outarray);
279 
281  Array<OneD, NekDouble> &array,
282  const StdRegions::StdMatrixKey &mkey);
283 
284  private:
287 
288  QuadExp();
289 
290  };
291 
292  // type defines for use of QuadExp in a boost vector
293  typedef boost::shared_ptr<QuadExp> QuadExpSharedPtr;
294  typedef std::vector< QuadExpSharedPtr > QuadExpVector;
296  }
297 }
298 
299 #endif
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:2161
virtual StdRegions::Orientation v_GetCartesianEorient(int edge)
Definition: QuadExp.cpp:1555
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2067
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:575
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:408
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: QuadExp.cpp:1561
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:285
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: QuadExp.h:286
std::vector< QuadExpSharedPtr >::iterator QuadExpVectorIter
Definition: QuadExp.h:295
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:2061
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:259
virtual int v_GetNumPoints(const int dir) const
Definition: QuadExp.cpp:1568
virtual const SpatialDomains::GeomFactorsSharedPtr & v_GetMetricInfo() const
Definition: QuadExp.cpp:1470
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:1919
virtual void v_GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:814
virtual void v_GetEdgePhysMap(const int edge, Array< OneD, int > &outarray)
Definition: QuadExp.cpp:880
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:202
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:739
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:2049
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2136
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2127
virtual StdRegions::Orientation v_GetEorient(int edge)
Definition: QuadExp.cpp:1549
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: QuadExp.cpp:627
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: QuadExp.cpp:618
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:534
std::vector< QuadExpSharedPtr > QuadExpVector
Definition: QuadExp.h:294
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: QuadExp.h:285
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: QuadExp.cpp:432
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:2055
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:423
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:1482
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:109
virtual void v_IProductWRTBase_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:462
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: QuadExp.cpp:1605
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2076
boost::shared_ptr< QuadExp > QuadExpSharedPtr
Definition: QuadExp.h:293
double NekDouble
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2117
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2097
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: QuadExp.cpp:611
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:2211
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:1573
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:478
virtual void v_GetEdgeQFactors(const int edge, Array< OneD, NekDouble > &outarray)
Definition: QuadExp.cpp:928
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:2107
virtual void v_ComputeLaplacianMetric()
Definition: QuadExp.cpp:2263
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: QuadExp.cpp:650
#define LOCAL_REGIONS_EXPORT
boost::shared_ptr< Basis > BasisSharedPtr
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual void v_ComputeEdgeNormal(const int edge)
Definition: QuadExp.cpp:1188
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: QuadExp.cpp:1594
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:2302
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:674
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:658