Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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);
125 
127  const int dir,
128  const Array<OneD, const NekDouble>& inarray,
129  Array<OneD, NekDouble> & outarray);
130 
133  const Array<OneD, const NekDouble> &Fy,
134  const Array<OneD, const NekDouble> &Fz,
135  Array< OneD, NekDouble> &outarray);
136 
138  const Array<OneD, const Array<OneD, NekDouble> > &Fvec,
139  Array<OneD, NekDouble> &outarray);
140 
141  //---------------------------------------
142  // Evaluation functions
143  //---------------------------------------
144  LOCAL_REGIONS_EXPORT virtual
146 
147  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
148  const Array<OneD, const NekDouble>& Lcoords,
149  Array<OneD,NekDouble> &coords);
150  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
151  Array<OneD, NekDouble> &coords_1,
152  Array<OneD, NekDouble> &coords_2,
153  Array<OneD, NekDouble> &coords_3);
155  const Array<OneD, const NekDouble> &Lcoord,
156  const Array<OneD, const NekDouble> &physvals);
158  const Array<OneD, const NekDouble> &coord,
159  const Array<OneD, const NekDouble> & physvals);
161  const int edge,
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);
170  const int edge,
171  const StdRegions::StdExpansionSharedPtr &EdgeExp,
172  const Array<OneD, const NekDouble> &inarray,
173  Array<OneD,NekDouble> &outarray,
174  StdRegions::Orientation orient);
176  const int edge,
177  const Array<OneD, const NekDouble> &inarray,
178  Array<OneD,NekDouble> &outarray);
180  const int edge,
181  Array<OneD, NekDouble> &outarray);
183  const int edge);
184 
185  //---------------------------------------
186  // Helper functions
187  //---------------------------------------
188  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
190  const NekDouble *data,
191  const std::vector<unsigned int > &nummodes,
192  const int mode_offset,
193  NekDouble *coeffs);
194  LOCAL_REGIONS_EXPORT virtual
196  LOCAL_REGIONS_EXPORT virtual
198  LOCAL_REGIONS_EXPORT virtual const
201  const int dir) const;
203  const int edge,
204  Array<OneD, int> &outarray);
205 
206 
207  //---------------------------------------
208  // Matrix creation functions
209  //---------------------------------------
210  LOCAL_REGIONS_EXPORT virtual
212  const StdRegions::StdMatrixKey &mkey);
213  LOCAL_REGIONS_EXPORT virtual
215  const StdRegions::StdMatrixKey &mkey);
216  LOCAL_REGIONS_EXPORT virtual
218  const MatrixKey &mkey);
219  LOCAL_REGIONS_EXPORT virtual
221  const MatrixKey &mkey);
222  LOCAL_REGIONS_EXPORT virtual
224  const MatrixKey &mkey);
225  LOCAL_REGIONS_EXPORT virtual
227  const MatrixKey &mkey);
228 
230  const MatrixKey &mkey);
231 
232 
234  const Array<OneD, const NekDouble> &inarray,
235  Array<OneD,NekDouble> &outarray,
236  const StdRegions::StdMatrixKey &mkey);
238  const Array<OneD, const NekDouble> &inarray,
239  Array<OneD,NekDouble> &outarray,
240  const StdRegions::StdMatrixKey &mkey);
242  const int k1,
243  const int k2,
244  const Array<OneD, const NekDouble> &inarray,
245  Array<OneD,NekDouble> &outarray,
246  const StdRegions::StdMatrixKey &mkey);
248  const int i,
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,
263  const StdRegions::StdMatrixKey &mkey);
265  const Array<OneD, const NekDouble> &inarray,
266  Array<OneD,NekDouble> &outarray,
267  const StdRegions::StdMatrixKey &mkey);
269  const Array<OneD, const NekDouble> &inarray,
270  Array<OneD, NekDouble> &outarray,
273  int numMin,
274  const Array<OneD, const NekDouble> &inarray,
275  Array<OneD,NekDouble> &outarray);
276 
278 
280  Array<OneD, NekDouble> &array,
281  const StdRegions::StdMatrixKey &mkey);
282 
283  private:
286 
287  TriExp();
288  };
289 
290  // type defines for use of TriExp in a boost vector
291  typedef boost::shared_ptr<TriExp> TriExpSharedPtr;
292  typedef std::vector< TriExpSharedPtr > TriExpVector;
294 
295  }
296 }
297 
298 #endif
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TriExp.h:284
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: TriExp.cpp:617
virtual int v_GetCoordim()
Definition: TriExp.cpp:968
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1456
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TriExp.h:285
virtual int v_GetNumPoints(const int dir) const
Definition: TriExp.cpp:1028
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1510
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:386
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:107
virtual void v_WeakDirectionalDerivMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1502
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:974
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: TriExp.cpp:603
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:195
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1034
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:245
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:646
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1518
virtual void v_IProductWRTDerivBase_MatOp(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:503
virtual void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:433
virtual void v_ComputeEdgeNormal(const int edge)
Definition: TriExp.cpp:803
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:542
virtual void v_ComputeLaplacianMetric()
Definition: TriExp.cpp:1601
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:379
virtual void v_IProductWRTBase_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:420
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
Definition: TriExp.cpp:83
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:636
virtual void v_GetEdgeQFactors(const int edge, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:754
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
virtual DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1335
double NekDouble
std::vector< TriExpSharedPtr > TriExpVector
Definition: TriExp.h:292
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: TriExp.cpp:578
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: TriExp.cpp:1021
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1526
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:263
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:625
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:1730
virtual StdRegions::Orientation v_GetCartesianEorient(int edge)
Definition: TriExp.cpp:1015
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1450
std::vector< TriExpSharedPtr >::iterator TriExpVectorIter
Definition: TriExp.h:293
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1493
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1792
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1468
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:586
virtual StdRegions::Orientation v_GetEorient(int edge)
Definition: TriExp.cpp:1009
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: TriExp.cpp:394
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1476
#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:1548
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1461
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual void v_GetEdgePhysMap(const int edge, Array< OneD, int > &outarray)
Definition: TriExp.cpp:764
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1057
Describes the specification for a Basis.
Definition: Basis.h:50
boost::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:291
virtual void v_GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:746
virtual DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1068