Nektar++
TriExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File TriExp.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 triangular elements.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef TRIEXP_H
37 #define TRIEXP_H
38 
39 #include <StdRegions/StdTriExp.h>
40 #include <SpatialDomains/TriGeom.h>
42 #include <LocalRegions/MatrixKey.h>
45 
46 namespace Nektar
47 {
48  namespace LocalRegions
49  {
50 
51  class TriExp: virtual public StdRegions::StdTriExp,
52  virtual public Expansion2D
53  {
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 TriExp(const TriExp &T);
66 
68 
69  protected:
70  //-------------------------------
71  // Integration Methods
72  //-------------------------------
74  const Array<OneD, const NekDouble> &inarray);
75 
76  //----------------------------
77  // Differentiation Methods
78  //----------------------------
79  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
80  const Array<OneD, const NekDouble> &inarray,
81  Array<OneD, NekDouble> &out_d0,
82  Array<OneD, NekDouble> &out_d1,
85  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
86  const int dir,
87  const Array<OneD, const NekDouble> &inarray,
88  Array<OneD, NekDouble> &outarray);
90  const Array<OneD, const NekDouble> &inarray,
91  const Array<OneD, const NekDouble> &direction,
93 
94  //---------------------------------------
95  // Transforms
96  //---------------------------------------
97  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
98  const Array<OneD, const NekDouble> &inarray,
99  Array<OneD, NekDouble> &outarray);
101  const Array<OneD, const NekDouble>& inarray,
102  Array<OneD, NekDouble> &outarray);
103 
104  //---------------------------------------
105  // Inner product functions
106  //---------------------------------------
108  const Array<OneD, const NekDouble>& inarray,
109  Array<OneD, NekDouble> &outarray);
111  const int dir,
112  const Array<OneD, const NekDouble>& inarray,
113  Array<OneD, NekDouble> & outarray);
115  const Array<OneD, const NekDouble>& inarray,
116  Array<OneD, NekDouble> &outarray,
117  bool multiplybyweights = true);
119  const Array<OneD, const NekDouble>& inarray,
120  Array<OneD, NekDouble> &outarray);
122  const int dir,
123  const Array<OneD, const NekDouble>& inarray,
124  Array<OneD, NekDouble> & outarray);
126  const int dir,
127  const Array<OneD, const NekDouble>& inarray,
128  Array<OneD, NekDouble> & outarray);
129 
132  const Array<OneD, const NekDouble> &Fy,
133  const Array<OneD, const NekDouble> &Fz,
134  Array< OneD, NekDouble> &outarray);
135 
136  //---------------------------------------
137  // Evaluation functions
138  //---------------------------------------
139  LOCAL_REGIONS_EXPORT virtual
141 
142  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
143  const Array<OneD, const NekDouble>& Lcoords,
144  Array<OneD,NekDouble> &coords);
145  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
146  Array<OneD, NekDouble> &coords_1,
147  Array<OneD, NekDouble> &coords_2,
148  Array<OneD, NekDouble> &coords_3);
150  const Array<OneD, const NekDouble> &Lcoord,
151  const Array<OneD, const NekDouble> &physvals);
153  const Array<OneD, const NekDouble> &coord,
154  const Array<OneD, const NekDouble> & physvals);
156  const int edge,
157  const Array<OneD, const NekDouble> &inarray,
158  Array<OneD, NekDouble> &outarray);
160  const int edge,
161  const StdRegions::StdExpansionSharedPtr &EdgeExp,
162  const Array<OneD, const NekDouble> &inarray,
163  Array<OneD,NekDouble> &outarray);
165  const int edge,
166  const StdRegions::StdExpansionSharedPtr &EdgeExp,
167  const Array<OneD, const NekDouble> &inarray,
168  Array<OneD,NekDouble> &outarray,
169  StdRegions::Orientation orient);
171  const int edge,
172  const Array<OneD, const NekDouble> &inarray,
173  Array<OneD,NekDouble> &outarray);
175  const int edge,
176  Array<OneD, NekDouble> &outarray);
178  const int edge);
179 
180  //---------------------------------------
181  // Helper functions
182  //---------------------------------------
183  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
185  const NekDouble *data,
186  const std::vector<unsigned int > &nummodes,
187  const int mode_offset,
188  NekDouble *coeffs);
189  LOCAL_REGIONS_EXPORT virtual
191  LOCAL_REGIONS_EXPORT virtual
193  LOCAL_REGIONS_EXPORT virtual const
196  const int dir) const;
197 
198 
199  //---------------------------------------
200  // Matrix creation functions
201  //---------------------------------------
202  LOCAL_REGIONS_EXPORT virtual
204  const StdRegions::StdMatrixKey &mkey);
205  LOCAL_REGIONS_EXPORT virtual
207  const StdRegions::StdMatrixKey &mkey);
208  LOCAL_REGIONS_EXPORT virtual
210  const MatrixKey &mkey);
211  LOCAL_REGIONS_EXPORT virtual
213  const MatrixKey &mkey);
214  LOCAL_REGIONS_EXPORT virtual
216  const MatrixKey &mkey);
217  LOCAL_REGIONS_EXPORT virtual
219  const MatrixKey &mkey);
220 
222  const MatrixKey &mkey);
223 
224 
226  const Array<OneD, const NekDouble> &inarray,
227  Array<OneD,NekDouble> &outarray,
228  const StdRegions::StdMatrixKey &mkey);
230  const Array<OneD, const NekDouble> &inarray,
231  Array<OneD,NekDouble> &outarray,
232  const StdRegions::StdMatrixKey &mkey);
234  const int k1,
235  const int k2,
236  const Array<OneD, const NekDouble> &inarray,
237  Array<OneD,NekDouble> &outarray,
238  const StdRegions::StdMatrixKey &mkey);
240  const int i,
241  const Array<OneD, const NekDouble> &inarray,
242  Array<OneD,NekDouble> &outarray,
243  const StdRegions::StdMatrixKey &mkey);
245  const Array<OneD, const NekDouble> &inarray,
246  Array<OneD,NekDouble> &outarray,
247  const StdRegions::StdMatrixKey &mkey);
249  const Array<OneD, const NekDouble> &inarray,
250  Array<OneD,NekDouble> &outarray,
251  const StdRegions::StdMatrixKey &mkey);
253  const Array<OneD, const NekDouble> &inarray,
254  Array<OneD,NekDouble> &outarray,
255  const StdRegions::StdMatrixKey &mkey);
257  const Array<OneD, const NekDouble> &inarray,
258  Array<OneD,NekDouble> &outarray,
259  const StdRegions::StdMatrixKey &mkey);
261  const Array<OneD, const NekDouble> &inarray,
262  Array<OneD, NekDouble> &outarray,
265  int numMin,
266  const Array<OneD, const NekDouble> &inarray,
267  Array<OneD,NekDouble> &outarray);
268 
270 
272  Array<OneD, NekDouble> &array,
273  const StdRegions::StdMatrixKey &mkey);
274 
275  private:
278 
279  TriExp();
280  };
281 
282  // type defines for use of TriExp in a boost vector
283  typedef boost::shared_ptr<TriExp> TriExpSharedPtr;
284  typedef std::vector< TriExpSharedPtr > TriExpVector;
286 
287  }
288 }
289 
290 #endif
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TriExp.h:276
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: TriExp.cpp:595
virtual int v_GetCoordim()
Definition: TriExp.cpp:903
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1391
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TriExp.h:277
virtual int v_GetNumPoints(const int dir) const
Definition: TriExp.cpp:963
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1445
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:371
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: TriExp.cpp:106
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1437
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: TriExp.cpp:909
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: TriExp.cpp:581
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: TriExp.cpp:194
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:969
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: TriExp.cpp:244
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
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: TriExp.cpp:624
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1453
virtual void v_IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:488
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:418
virtual void v_ComputeEdgeNormal(const int edge)
Definition: TriExp.cpp:738
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: TriExp.cpp:527
virtual void v_ComputeLaplacianMetric()
Definition: TriExp.cpp:1536
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[p]*base1[pq] and put into ou...
Definition: TriExp.cpp:364
virtual void v_IProductWRTBase_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:405
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
Definition: TriExp.cpp:82
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: TriExp.cpp:614
virtual void v_GetEdgeQFactors(const int edge, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:729
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
virtual DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1270
double NekDouble
std::vector< TriExpSharedPtr > TriExpVector
Definition: TriExp.h:284
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: TriExp.cpp:556
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: TriExp.cpp:956
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1461
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:262
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: TriExp.cpp:603
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:1665
virtual StdRegions::Orientation v_GetCartesianEorient(int edge)
Definition: TriExp.cpp:950
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1385
std::vector< TriExpSharedPtr >::iterator TriExpVectorIter
Definition: TriExp.h:285
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1428
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1727
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1403
boost::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: TriExp.cpp:564
virtual StdRegions::Orientation v_GetEorient(int edge)
Definition: TriExp.cpp:944
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: TriExp.cpp:379
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1411
#define LOCAL_REGIONS_EXPORT
boost::shared_ptr< Basis > BasisSharedPtr
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Definition: TriExp.cpp:1483
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1396
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:992
Describes the specification for a Basis.
Definition: Basis.h:50
boost::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:283
virtual void v_GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:721
virtual DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1003