Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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
149 
150  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
151  const Array<OneD, const NekDouble>& Lcoords,
152  Array<OneD,NekDouble> &coords);
153  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
154  Array<OneD, NekDouble> &coords_1,
155  Array<OneD, NekDouble> &coords_2,
156  Array<OneD, NekDouble> &coords_3);
158  const Array<OneD, const NekDouble> &Lcoord,
159  const Array<OneD, const NekDouble> &physvals);
161  const Array<OneD, const NekDouble> &coord,
162  const Array<OneD, const NekDouble> & physvals);
164  const int edge,
165  const Array<OneD, const NekDouble> &inarray,
166  Array<OneD, NekDouble> &outarray);
168  const int edge,
169  const StdRegions::StdExpansionSharedPtr &EdgeExp,
170  const Array<OneD, const NekDouble> &inarray,
171  Array<OneD,NekDouble> &outarray);
173  const int edge,
174  const StdRegions::StdExpansionSharedPtr &EdgeExp,
175  const Array<OneD, const NekDouble> &inarray,
176  Array<OneD,NekDouble> &outarray,
177  StdRegions::Orientation orient);
179  const int edge,
180  const Array<OneD, const NekDouble> &inarray,
181  Array<OneD,NekDouble> &outarray);
183  const int edge,
184  Array<OneD, NekDouble> &outarray);
186  const int edge);
187 
188  //---------------------------------------
189  // Helper functions
190  //---------------------------------------
191  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
193  const NekDouble *data,
194  const std::vector<unsigned int > &nummodes,
195  const int mode_offset,
196  NekDouble *coeffs,
197  std::vector<LibUtilities::BasisType> &fromType);
198  LOCAL_REGIONS_EXPORT virtual
200  LOCAL_REGIONS_EXPORT virtual
202  LOCAL_REGIONS_EXPORT virtual const
205  const int dir) const;
207  const int edge,
208  Array<OneD, int> &outarray);
209 
210 
211  //---------------------------------------
212  // Matrix creation functions
213  //---------------------------------------
214  LOCAL_REGIONS_EXPORT virtual
216  const StdRegions::StdMatrixKey &mkey);
217  LOCAL_REGIONS_EXPORT virtual
219  const StdRegions::StdMatrixKey &mkey);
220  LOCAL_REGIONS_EXPORT virtual
222  const MatrixKey &mkey);
223  LOCAL_REGIONS_EXPORT virtual
225  const MatrixKey &mkey);
226  LOCAL_REGIONS_EXPORT virtual
228  const MatrixKey &mkey);
229  LOCAL_REGIONS_EXPORT virtual
231  const MatrixKey &mkey);
232 
234  const MatrixKey &mkey);
235 
236 
238  const Array<OneD, const NekDouble> &inarray,
239  Array<OneD,NekDouble> &outarray,
240  const StdRegions::StdMatrixKey &mkey);
242  const Array<OneD, const NekDouble> &inarray,
243  Array<OneD,NekDouble> &outarray,
244  const StdRegions::StdMatrixKey &mkey);
246  const int k1,
247  const int k2,
248  const Array<OneD, const NekDouble> &inarray,
249  Array<OneD,NekDouble> &outarray,
250  const StdRegions::StdMatrixKey &mkey);
252  const int i,
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,
271  const StdRegions::StdMatrixKey &mkey);
273  const Array<OneD, const NekDouble> &inarray,
274  Array<OneD, NekDouble> &outarray,
277  int numMin,
278  const Array<OneD, const NekDouble> &inarray,
279  Array<OneD,NekDouble> &outarray);
280 
282 
284  Array<OneD, NekDouble> &array,
285  const StdRegions::StdMatrixKey &mkey);
286 
287  private:
290 
291  TriExp();
292  };
293 
294  // type defines for use of TriExp in a boost vector
295  typedef boost::shared_ptr<TriExp> TriExpSharedPtr;
296  typedef std::vector< TriExpSharedPtr > TriExpVector;
298 
299  }
300 }
301 
302 #endif
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: TriExp.h:288
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: TriExp.cpp:628
virtual int v_GetCoordim()
Definition: TriExp.cpp:979
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1471
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: TriExp.h:289
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: TriExp.cpp:586
virtual int v_GetNumPoints(const int dir) const
Definition: TriExp.cpp:1043
virtual void v_MassLevelCurvatureMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1525
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:1517
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: TriExp.cpp:614
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:1049
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:657
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1533
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: TriExp.cpp:985
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:814
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:1616
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:647
virtual void v_GetEdgeQFactors(const int edge, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:765
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
virtual DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1350
double NekDouble
std::vector< TriExpSharedPtr > TriExpVector
Definition: TriExp.h:296
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: TriExp.cpp:578
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: TriExp.cpp:1036
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1541
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:636
virtual void v_ReduceOrderCoeffs(int numMin, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:1745
virtual StdRegions::Orientation v_GetCartesianEorient(int edge)
Definition: TriExp.cpp:1030
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1465
std::vector< TriExpSharedPtr >::iterator TriExpVectorIter
Definition: TriExp.h:297
virtual void v_WeakDerivMatrixOp(const int i, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1508
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1807
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1483
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:597
virtual StdRegions::Orientation v_GetEorient(int edge)
Definition: TriExp.cpp:1024
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:1491
#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:1563
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1476
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual void v_GetEdgePhysMap(const int edge, Array< OneD, int > &outarray)
Definition: TriExp.cpp:775
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: TriExp.cpp:1072
Describes the specification for a Basis.
Definition: Basis.h:50
boost::shared_ptr< TriExp > TriExpSharedPtr
Definition: TriExp.h:295
virtual void v_GetEdgeInterpVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: TriExp.cpp:757
virtual DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: TriExp.cpp:1083