Nektar++
SegExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File SegExp.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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Header file for SegExp routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef SEGEXP_H
36 #define SEGEXP_H
37 
38 #include <StdRegions/StdSegExp.h>
40 #include <LocalRegions/MatrixKey.h>
43 
44 //#include <fstream>
45 
46 namespace Nektar
47 {
48  namespace LocalRegions
49  {
50 
51  class SegExp: virtual public StdRegions::StdSegExp, virtual public Expansion1D
52  {
53 
54  public:
56  const LibUtilities::BasisKey &Ba,
58 
59  LOCAL_REGIONS_EXPORT SegExp(const SegExp &S);
60 
62 
63  protected:
64 
65  //----------------------------
66  // Integration Methods
67  //----------------------------
69  const Array<OneD, const NekDouble>& inarray);
70 
71  //-----------------------------
72  // Differentiation Methods
73  //-----------------------------
74  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
75  const Array<OneD, const NekDouble>& inarray,
76  Array<OneD,NekDouble> &out_d0,
79 
80  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(const int dir,
81  const Array<OneD, const NekDouble>& inarray,
82  Array<OneD, NekDouble> &outarray);
83 
85  const Array<OneD, const NekDouble>& inarray,
86  Array<OneD, NekDouble> &out_ds);
87 
89  const Array<OneD, const NekDouble>& inarray,
90  Array<OneD, NekDouble>& out_dn);
91 
92  //-----------------------------
93  // Transforms
94  //-----------------------------
95  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
96  const Array<OneD, const NekDouble>& inarray,
97  Array<OneD,NekDouble> &outarray);
98 
100  const Array<OneD, const NekDouble>& inarray,
101  Array<OneD, NekDouble> &outarray);
102 
103  //-----------------------------
104  // Inner product functions
105  //-----------------------------
107  const Array<OneD, const NekDouble>& inarray,
108  Array<OneD, NekDouble> &outarray);
109 
111  const Array<OneD, const NekDouble>& base,
112  const Array<OneD, const NekDouble>& inarray,
113  Array<OneD, NekDouble> &outarray,
114  int coll_check);
115 
117  const int dir,
118  const Array<OneD, const NekDouble>& inarray,
119  Array<OneD, NekDouble> & outarray);
120 
124  Array<OneD, NekDouble> &outarray);
125 
127  const Array<OneD, const Array<OneD, NekDouble> > &Fvec,
128  Array<OneD, NekDouble> &outarray);
129 
130  //-----------------------------
131  // Evaluation functions
132  //-----------------------------
134  const Array<OneD, const NekDouble> &Lcoord,
135  const Array<OneD, const NekDouble> &physvals);
136 
138  const Array<OneD, const NekDouble>& coord,
139  const Array<OneD, const NekDouble> & physvals);
140 
141  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
142  const Array<OneD, const NekDouble>& Lcoords,
143  Array<OneD,NekDouble> &coords);
144 
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);
149 
151  const int vertex,
152  const Array<OneD, const NekDouble> &inarray,
153  NekDouble &outarray);
154 
156  const int edge,
157  const StdRegions::StdExpansionSharedPtr &EdgeExp,
158  const Array<OneD, const NekDouble> &inarray,
159  Array<OneD, NekDouble> &outarray,
160  StdRegions::Orientation orient);
161 
162  //-----------------------------
163  // Helper functions
164  //-----------------------------
165  LOCAL_REGIONS_EXPORT virtual
167 
168  LOCAL_REGIONS_EXPORT virtual
170 
171  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
172 
174  Array<OneD, NekDouble> &coeffs,
176 
180  Array<OneD, NekDouble> &outarray);
181 
182  LOCAL_REGIONS_EXPORT virtual int v_GetNumPoints(const int dir) const;
183 
184  LOCAL_REGIONS_EXPORT virtual int v_GetNcoeffs(void) const;
185 
186  LOCAL_REGIONS_EXPORT virtual const
188 
189  LOCAL_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
190 
191  LOCAL_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
192 
194  const int vertex);
195 
197 
199  const NekDouble *data,
200  const std::vector<unsigned int > &nummodes,
201  const int mode_offset,
202  NekDouble *coeffs,
203  std::vector<LibUtilities::BasisType> &fromType);
204 
205  LOCAL_REGIONS_EXPORT virtual const
207 
208  //-----------------------------
209  // Operator creation functions
210  //-----------------------------
212  const Array<OneD, const NekDouble> &inarray,
213  Array<OneD, NekDouble> &outarray,
214  const StdRegions::StdMatrixKey &mkey);
215 
217  const Array<OneD, const NekDouble> &inarray,
218  Array<OneD, NekDouble> &outarray,
219  const StdRegions::StdMatrixKey &mkey);
220 
221  //-----------------------------
222  // Matrix creation functions
223  //-----------------------------
224 
227 
229 
232 
234  const MatrixKey &mkey);
235 
237  v_GetLocMatrix(const MatrixKey &mkey);
238 
240  v_GetLocStaticCondMatrix(const MatrixKey &mkey);
241 
243  const MatrixKey &mkey);
244 
245  private:
250 
251  SegExp();
252 
254  const Array<OneD,NekDouble> &inarray,
255  Array<OneD,NekDouble> &outarray);
256 
257 
258  /// \todo Same method exists in ExpList and everyone references
259  /// ExpList::MultiplyByElmtInvMass. Remove this one?
261  const Array<OneD, const NekDouble>& inarray,
262  Array<OneD,NekDouble> &outarray);
263 
264  };
265 
266  typedef std::shared_ptr<SegExp> SegExpSharedPtr;
267  typedef std::vector< SegExpSharedPtr > SegExpVector;
268  } //end of namespace
269 } //end of namespace
270 
271 #endif // SEGEXP_H
virtual int v_GetNcoeffs(void) const
Definition: SegExp.cpp:824
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1189
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: SegExp.cpp:682
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1195
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:249
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: SegExp.cpp:661
virtual int v_NumDGBndryCoeffs() const
Definition: SegExp.cpp:841
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1074
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:73
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
Definition: SegExp.cpp:377
virtual void v_PhysDeriv_n(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_dn)
Evaluate the derivative normal to a line: . The derivative is calculated performing the product ...
Definition: SegExp.cpp:269
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: SegExp.cpp:743
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
Unpack data from input file assuming it comes from.
Definition: SegExp.cpp:849
std::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:69
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Inner product of inarray over region with respect to the expansion basis (this)->_Base[0] and return ...
Definition: SegExp.cpp:506
virtual void v_PhysDeriv_s(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_ds)
Evaluate the derivative along a line: . The derivative is calculated performing the product ...
Definition: SegExp.cpp:229
std::shared_ptr< Basis > BasisSharedPtr
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:624
Class representing a segment element in reference space.
Definition: StdSegExp.h:53
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: SegExp.cpp:794
void ReverseCoeffsAndSign(const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Reverse the coefficients in a boundary interior expansion this routine is of use when we need the seg...
Definition: SegExp.cpp:1598
virtual SpatialDomains::GeomType v_MetricInfoType()
Definition: SegExp.cpp:814
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1427
virtual void v_ComputeVertexNormal(const int vertex)
Definition: SegExp.cpp:902
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: SegExp.cpp:788
virtual int v_NumBndryCoeffs() const
Definition: SegExp.cpp:835
double NekDouble
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: SegExp.cpp:829
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals(void)
Definition: SegExp.cpp:808
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1451
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:401
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:966
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1217
virtual int v_GetNumPoints(const int dir) const
Definition: SegExp.cpp:819
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1200
virtual void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
Definition: SegExp.cpp:707
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: SegExp.cpp:698
virtual void v_SetCoeffsToOrientation(Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
Definition: SegExp.cpp:761
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:1640
std::shared_ptr< SegExp > SegExpSharedPtr
Definition: SegExp.h:266
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1=NullNekDouble1DArray, Array< OneD, NekDouble > &out_d2=NullNekDouble1DArray)
Evaluate the derivative at the physical quadrature points given by inarray and return in outarray...
Definition: SegExp.cpp:166
std::vector< SegExpSharedPtr > SegExpVector
Definition: SegExp.h:267
virtual int v_GetCoordim()
Definition: SegExp.cpp:803
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over region and return the value.
Definition: SegExp.cpp:118
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:63
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1206
GeomType
Indicates the type of element geometry.
#define LOCAL_REGIONS_EXPORT
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:565
Describes the specification for a Basis.
Definition: Basis.h:49
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals)
Definition: SegExp.cpp:669
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:247