Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // 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: Header file for SegExp routines
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef SEGEXP_H
37 #define SEGEXP_H
38 
39 #include <StdRegions/StdSegExp.h>
41 #include <LocalRegions/MatrixKey.h>
44 
45 //#include <fstream>
46 
47 namespace Nektar
48 {
49  namespace LocalRegions
50  {
51 
52  class SegExp: virtual public StdRegions::StdSegExp, virtual public Expansion1D
53  {
54 
55  public:
57  const LibUtilities::BasisKey &Ba,
59 
60  LOCAL_REGIONS_EXPORT SegExp(const SegExp &S);
61 
63 
64  protected:
65 
66  //----------------------------
67  // Integration Methods
68  //----------------------------
70  const Array<OneD, const NekDouble>& inarray);
71 
72  //-----------------------------
73  // Differentiation Methods
74  //-----------------------------
75  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
76  const Array<OneD, const NekDouble>& inarray,
77  Array<OneD,NekDouble> &out_d0,
80 
81  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(const int dir,
82  const Array<OneD, const NekDouble>& inarray,
83  Array<OneD, NekDouble> &outarray);
84 
86  const Array<OneD, const NekDouble>& inarray,
87  Array<OneD, NekDouble> &out_ds);
88 
90  const Array<OneD, const NekDouble>& inarray,
91  Array<OneD, NekDouble>& out_dn);
92 
93  //-----------------------------
94  // Transforms
95  //-----------------------------
96  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
97  const Array<OneD, const NekDouble>& inarray,
98  Array<OneD,NekDouble> &outarray);
99 
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);
110 
112  const Array<OneD, const NekDouble>& base,
113  const Array<OneD, const NekDouble>& inarray,
114  Array<OneD, NekDouble> &outarray,
115  int coll_check);
116 
118  const int dir,
119  const Array<OneD, const NekDouble>& inarray,
120  Array<OneD, NekDouble> & outarray);
121 
125  Array<OneD, NekDouble> &outarray);
126 
128  const Array<OneD, const Array<OneD, NekDouble> > &Fvec,
129  Array<OneD, NekDouble> &outarray);
130 
131  //-----------------------------
132  // Evaluation functions
133  //-----------------------------
135  const Array<OneD, const NekDouble> &Lcoord,
136  const Array<OneD, const NekDouble> &physvals);
137 
139  const Array<OneD, const NekDouble>& coord,
140  const Array<OneD, const NekDouble> & physvals);
141 
142  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
143  const Array<OneD, const NekDouble>& Lcoords,
144  Array<OneD,NekDouble> &coords);
145 
146  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
147  Array<OneD, NekDouble> &coords_1,
148  Array<OneD, NekDouble> &coords_2,
149  Array<OneD, NekDouble> &coords_3);
150 
152  const int vertex,
153  const Array<OneD, const NekDouble> &inarray,
154  NekDouble &outarray);
155 
157  const int edge,
158  const StdRegions::StdExpansionSharedPtr &EdgeExp,
159  const Array<OneD, const NekDouble> &inarray,
160  Array<OneD, NekDouble> &outarray,
161  StdRegions::Orientation orient);
162 
163  //-----------------------------
164  // Helper functions
165  //-----------------------------
166  LOCAL_REGIONS_EXPORT virtual
168 
169  LOCAL_REGIONS_EXPORT virtual
171 
172  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
173 
175  Array<OneD, NekDouble> &coeffs,
177 
181  Array<OneD, NekDouble> &outarray);
182 
183  LOCAL_REGIONS_EXPORT virtual int v_GetNumPoints(const int dir) const;
184 
185  LOCAL_REGIONS_EXPORT virtual int v_GetNcoeffs(void) const;
186 
187  LOCAL_REGIONS_EXPORT virtual const
189 
190  LOCAL_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
191 
192  LOCAL_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
193 
195  const int vertex);
196 
198 
200 
202  const NekDouble *data,
203  const std::vector<unsigned int > &nummodes,
204  const int mode_offset,
205  NekDouble *coeffs,
206  std::vector<LibUtilities::BasisType> &fromType);
207 
208  LOCAL_REGIONS_EXPORT virtual const
210 
211  //-----------------------------
212  // Operator creation functions
213  //-----------------------------
215  const Array<OneD, const NekDouble> &inarray,
216  Array<OneD, NekDouble> &outarray,
217  const StdRegions::StdMatrixKey &mkey);
218 
220  const Array<OneD, const NekDouble> &inarray,
221  Array<OneD, NekDouble> &outarray,
222  const StdRegions::StdMatrixKey &mkey);
223 
224  //-----------------------------
225  // Matrix creation functions
226  //-----------------------------
227 
230 
232 
235 
237  const MatrixKey &mkey);
238 
240  v_GetLocMatrix(const MatrixKey &mkey);
241 
243  v_GetLocStaticCondMatrix(const MatrixKey &mkey);
244 
246  const MatrixKey &mkey);
247 
248  private:
253 
254  SegExp();
255 
257  const Array<OneD,NekDouble> &inarray,
258  Array<OneD,NekDouble> &outarray);
259 
260 
261  /// \todo Same method exists in ExpList and everyone references
262  /// ExpList::MultiplyByElmtInvMass. Remove this one?
264  const Array<OneD, const NekDouble>& inarray,
265  Array<OneD,NekDouble> &outarray);
266 
267  };
268 
269  // type defines for use of SegExp in a boost vector
270  typedef boost::shared_ptr<SegExp> SegExpSharedPtr;
271  typedef std::vector< SegExpSharedPtr > SegExpVector;
273 
274 
275  } //end of namespace
276 } //end of namespace
277 
278 #endif // SEGEXP_H
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1180
virtual StdRegions::StdExpansionSharedPtr v_GetLinStdExp(void) const
Definition: SegExp.cpp:795
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: SegExp.cpp:830
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: SegExp.cpp:679
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1186
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:252
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: SegExp.cpp:658
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1065
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:376
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:268
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:740
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:850
virtual int v_GetNcoeffs(void) const
Definition: SegExp.cpp:825
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: SegExp.cpp:789
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:503
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:228
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
virtual int v_GetNumPoints(const int dir) const
Definition: SegExp.cpp:820
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:621
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
Class representing a segment element in reference space.
Definition: StdSegExp.h:54
boost::shared_ptr< SegExp > SegExpSharedPtr
Definition: SegExp.h:270
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:1589
virtual SpatialDomains::GeomType v_MetricInfoType()
Definition: SegExp.cpp:815
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1418
virtual StdRegions::Orientation v_GetPorient(int point)
Definition: SegExp.cpp:783
virtual void v_ComputeVertexNormal(const int vertex)
Definition: SegExp.cpp:895
std::vector< SegExpSharedPtr >::iterator SegExpVectorIter
Definition: SegExp.h:272
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
double NekDouble
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals(void)
Definition: SegExp.cpp:809
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1442
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:400
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:959
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1208
bg::model::point< double, 3, bg::cs::cartesian > point
Definition: BLMesh.cpp:54
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1191
virtual void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
Definition: SegExp.cpp:704
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: SegExp.cpp:695
virtual void v_SetCoeffsToOrientation(Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
Definition: SegExp.cpp:756
virtual int v_NumDGBndryCoeffs() const
Definition: SegExp.cpp:842
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:1631
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:165
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry1D.h:48
std::vector< SegExpSharedPtr > SegExpVector
Definition: SegExp.h:271
virtual int v_GetCoordim()
Definition: SegExp.cpp:804
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:117
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1197
GeomType
Indicates the type of element geometry.
#define LOCAL_REGIONS_EXPORT
boost::shared_ptr< Basis > BasisSharedPtr
virtual void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:562
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
Describes the specification for a Basis.
Definition: Basis.h:50
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals)
Definition: SegExp.cpp:666
virtual int v_NumBndryCoeffs() const
Definition: SegExp.cpp:836
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:250