Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 int v_GetCoordim();
170 
172  Array<OneD, NekDouble> &coeffs,
174 
178  Array<OneD, NekDouble> &outarray);
179 
180  LOCAL_REGIONS_EXPORT virtual int v_GetNumPoints(const int dir) const;
181 
182  LOCAL_REGIONS_EXPORT virtual int v_GetNcoeffs(void) const;
183 
184  LOCAL_REGIONS_EXPORT virtual const
186 
187  LOCAL_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
188 
189  LOCAL_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
190 
192  const int vertex);
193 
195 
197 
199  const NekDouble *data,
200  const std::vector<unsigned int > &nummodes,
201  const int mode_offset,
202  NekDouble *coeffs);
203 
204  LOCAL_REGIONS_EXPORT virtual const
206 
207  //-----------------------------
208  // Operator creation functions
209  //-----------------------------
211  const Array<OneD, const NekDouble> &inarray,
212  Array<OneD, NekDouble> &outarray,
213  const StdRegions::StdMatrixKey &mkey);
214 
216  const Array<OneD, const NekDouble> &inarray,
217  Array<OneD, NekDouble> &outarray,
218  const StdRegions::StdMatrixKey &mkey);
219 
220  //-----------------------------
221  // Matrix creation functions
222  //-----------------------------
223 
226 
228 
231 
233  const MatrixKey &mkey);
234 
236  v_GetLocMatrix(const MatrixKey &mkey);
237 
239  v_GetLocStaticCondMatrix(const MatrixKey &mkey);
240 
242  const MatrixKey &mkey);
243 
244  private:
249 
250  SegExp();
251 
253  const Array<OneD,NekDouble> &inarray,
254  Array<OneD,NekDouble> &outarray);
255 
256 
257  /// \todo Same method exists in ExpList and everyone references
258  /// ExpList::MultiplyByElmtInvMass. Remove this one?
260  const Array<OneD, const NekDouble>& inarray,
261  Array<OneD,NekDouble> &outarray);
262 
263  };
264 
265  // type defines for use of SegExp in a boost vector
266  typedef boost::shared_ptr<SegExp> SegExpSharedPtr;
267  typedef std::vector< SegExpSharedPtr > SegExpVector;
269 
270 
271  } //end of namespace
272 } //end of namespace
273 
274 #endif // SEGEXP_H
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1170
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: SegExp.cpp:821
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:1176
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:248
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:1055
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_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.
Definition: SegExp.cpp:841
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 int v_GetNcoeffs(void) const
Definition: SegExp.cpp:816
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:811
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:266
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:1579
virtual SpatialDomains::GeomType v_MetricInfoType()
Definition: SegExp.cpp:806
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1408
virtual StdRegions::Orientation v_GetPorient(int point)
Definition: SegExp.cpp:783
virtual void v_ComputeVertexNormal(const int vertex)
Definition: SegExp.cpp:885
std::vector< SegExpSharedPtr >::iterator SegExpVectorIter
Definition: SegExp.h:268
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
double NekDouble
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals(void)
Definition: SegExp.cpp:800
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1432
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:949
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1198
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1181
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:833
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:1621
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:267
virtual int v_GetCoordim()
Definition: SegExp.cpp:795
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:1187
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:827
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:246