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 // 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 
127  //-----------------------------
128  // Evaluation functions
129  //-----------------------------
131  const Array<OneD, const NekDouble> &Lcoord,
132  const Array<OneD, const NekDouble> &physvals);
133 
135  const Array<OneD, const NekDouble>& coord,
136  const Array<OneD, const NekDouble> & physvals);
137 
138  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
139  const Array<OneD, const NekDouble>& Lcoords,
140  Array<OneD,NekDouble> &coords);
141 
142  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
143  Array<OneD, NekDouble> &coords_1,
144  Array<OneD, NekDouble> &coords_2,
145  Array<OneD, NekDouble> &coords_3);
146 
148  const int vertex,
149  const Array<OneD, const NekDouble> &inarray,
150  NekDouble &outarray);
151 
152  //-----------------------------
153  // Helper functions
154  //-----------------------------
155  LOCAL_REGIONS_EXPORT virtual
157 
158  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
159 
161  Array<OneD, NekDouble> &coeffs,
163 
167  Array<OneD, NekDouble> &outarray);
168 
169  LOCAL_REGIONS_EXPORT virtual int v_GetNumPoints(const int dir) const;
170 
171  LOCAL_REGIONS_EXPORT virtual int v_GetNcoeffs(void) const;
172 
173  LOCAL_REGIONS_EXPORT virtual const
175 
176  LOCAL_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
177 
178  LOCAL_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
179 
181  const int vertex);
182 
184 
186 
188  const NekDouble *data,
189  const std::vector<unsigned int > &nummodes,
190  const int mode_offset,
191  NekDouble *coeffs);
192 
193  LOCAL_REGIONS_EXPORT virtual const
195 
196  //-----------------------------
197  // Operator creation functions
198  //-----------------------------
200  const Array<OneD, const NekDouble> &inarray,
201  Array<OneD, NekDouble> &outarray,
202  const StdRegions::StdMatrixKey &mkey);
203 
205  const Array<OneD, const NekDouble> &inarray,
206  Array<OneD, NekDouble> &outarray,
207  const StdRegions::StdMatrixKey &mkey);
208 
209  //-----------------------------
210  // Matrix creation functions
211  //-----------------------------
212 
215 
217 
220 
222  const MatrixKey &mkey);
223 
225  v_GetLocMatrix(const MatrixKey &mkey);
226 
228  v_GetLocStaticCondMatrix(const MatrixKey &mkey);
229 
231  const MatrixKey &mkey);
232 
233  private:
238 
239  SegExp();
240 
242  const Array<OneD,NekDouble> &inarray,
243  Array<OneD,NekDouble> &outarray);
244 
245 
246  /// \todo Same method exists in ExpList and everyone references
247  /// ExpList::MultiplyByElmtInvMass. Remove this one?
249  const Array<OneD, const NekDouble>& inarray,
250  Array<OneD,NekDouble> &outarray);
251 
252  };
253 
254  // type defines for use of SegExp in a boost vector
255  typedef boost::shared_ptr<SegExp> SegExpSharedPtr;
256  typedef std::vector< SegExpSharedPtr > SegExpVector;
258 
259 
260  } //end of namespace
261 } //end of namespace
262 
263 #endif // SEGEXP_H
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1149
virtual const LibUtilities::BasisSharedPtr & v_GetBasis(int dir) const
Definition: SegExp.cpp:800
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Definition: SegExp.cpp:670
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1155
static Array< OneD, NekDouble > NullNekDouble1DArray
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: SegExp.h:237
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: SegExp.cpp:649
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1034
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:375
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:267
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:820
virtual int v_GetNcoeffs(void) const
Definition: SegExp.cpp:795
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: SegExp.cpp:768
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:501
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:227
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
virtual int v_GetNumPoints(const int dir) const
Definition: SegExp.cpp:790
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:619
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:255
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:1558
virtual SpatialDomains::GeomType v_MetricInfoType()
Definition: SegExp.cpp:785
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1387
virtual StdRegions::Orientation v_GetPorient(int point)
Definition: SegExp.cpp:762
virtual void v_ComputeVertexNormal(const int vertex)
Definition: SegExp.cpp:864
std::vector< SegExpSharedPtr >::iterator SegExpVectorIter
Definition: SegExp.h:257
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
double NekDouble
virtual const Array< OneD, const NekDouble > & v_GetPhysNormals(void)
Definition: SegExp.cpp:779
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1411
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:399
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:928
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1177
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: SegExp.cpp:1160
virtual void v_GetVertexPhysVals(const int vertex, const Array< OneD, const NekDouble > &inarray, NekDouble &outarray)
Definition: SegExp.cpp:695
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:686
virtual void v_SetCoeffsToOrientation(Array< OneD, NekDouble > &coeffs, StdRegions::Orientation dir)
Definition: SegExp.cpp:735
virtual int v_NumDGBndryCoeffs() const
Definition: SegExp.cpp:812
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: SegExp.cpp:1600
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:164
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry1D.h:48
std::vector< SegExpSharedPtr > SegExpVector
Definition: SegExp.h:256
virtual int v_GetCoordim()
Definition: SegExp.cpp:774
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:116
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: SegExp.cpp:1166
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:560
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:657
virtual int v_NumBndryCoeffs() const
Definition: SegExp.cpp:806
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: SegExp.h:235