Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Expansion.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File Expansion.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 Expansion routines
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef EXPANSION_H
37 #define EXPANSION_H
38 
43 #include <boost/shared_ptr.hpp>
44 #include <boost/weak_ptr.hpp>
45 #include <vector>
46 #include <map>
47 
48 namespace Nektar
49 {
50  namespace LocalRegions
51  {
52 
53  class Expansion;
54  class MatrixKey;
55 
57  {
65  };
66 
67  // type defines for use of PrismExp in a boost vector
68  typedef boost::shared_ptr<Expansion> ExpansionSharedPtr;
69  typedef boost::weak_ptr<Expansion> ExpansionWeakPtr;
70  typedef std::vector< ExpansionSharedPtr > ExpansionVector;
72  typedef std::map<MetricType, Array<OneD, NekDouble> > MetricMap;
73 
74  class Expansion : virtual public StdRegions::StdExpansion
75  {
76  public:
78  LOCAL_REGIONS_EXPORT Expansion(const Expansion &pSrc); // copy constructor.
80 
82 
86 
88 
90 
91  LOCAL_REGIONS_EXPORT virtual const
93 
95  const DNekScalMatSharedPtr &r_bnd,
96  const StdRegions::MatrixType matrixType);
97 
99  const DNekScalMatSharedPtr &r_bnd);
101  const NekDouble *data,
102  const std::vector<unsigned int > &nummodes,
103  const int nmodes_offset,
104  NekDouble *coeffs,
105  std::vector<LibUtilities::BasisType> &fromType);
107  const int edge,
108  const boost::shared_ptr<Expansion> &EdgeExp,
111  Array<OneD, NekDouble> &outarray);
113  const int edge,
114  const boost::shared_ptr<Expansion> &EdgeExp,
116  Array<OneD, NekDouble> &outarray);
118  const int face,
119  const boost::shared_ptr<Expansion> &FaceExp,
121  Array<OneD, NekDouble> &outarray);
123  const int dir,
124  const Array<OneD, const NekDouble>& inarray,
126  Array<OneD, Array<OneD, NekDouble> > &coeffs,
127  Array<OneD, NekDouble> &outarray);
128 
129  protected:
132  MetricMap m_metrics;
133 
134  void ComputeLaplacianMetric();
136 
137  virtual void v_MultiplyByQuadratureMetric(
138  const Array<OneD, const NekDouble> &inarray,
139  Array<OneD, NekDouble> &outarray);
140 
141  virtual void v_ComputeLaplacianMetric() {};
142 
143  virtual void v_GetCoords(Array<OneD,NekDouble> &coords_1,
144  Array<OneD,NekDouble> &coords_2,
145  Array<OneD,NekDouble> &coords_3);
146 
148 
150  const DNekScalMatSharedPtr &r_bnd,
151  const StdRegions::MatrixType matrixType);
152 
154  const DNekScalMatSharedPtr &r_bnd);
155  virtual void v_ExtractDataToCoeffs(
156  const NekDouble *data,
157  const std::vector<unsigned int > &nummodes,
158  const int nmodes_offset,
159  NekDouble *coeffs,
160  std::vector<LibUtilities::BasisType> &fromType);
161  virtual void v_AddEdgeNormBoundaryInt(
162  const int edge,
163  const boost::shared_ptr<Expansion> &EdgeExp,
166  Array<OneD, NekDouble> &outarray);
167  virtual void v_AddEdgeNormBoundaryInt(
168  const int edge,
169  const boost::shared_ptr<Expansion> &EdgeExp,
171  Array<OneD, NekDouble> &outarray);
172  virtual void v_AddFaceNormBoundaryInt(
173  const int face,
174  const boost::shared_ptr<Expansion> &FaceExp,
176  Array<OneD, NekDouble> &outarray);
177  virtual void v_DGDeriv(
178  const int dir,
179  const Array<OneD, const NekDouble>& inarray,
181  Array<OneD, Array<OneD, NekDouble> > &coeffs,
182  Array<OneD, NekDouble> &outarray);
183 
184  private:
185 
186  };
187  } //end of namespace
188 } //end of namespace
189 
190 #endif
boost::weak_ptr< Expansion > ExpansionWeakPtr
Definition: Expansion.h:69
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
Definition: Expansion.cpp:90
void ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
Definition: Expansion.cpp:105
virtual void v_MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:187
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:131
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
Definition: Expansion.cpp:98
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:252
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:130
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
std::vector< ExpansionSharedPtr >::iterator ExpansionVectorIter
Definition: Expansion.h:71
std::vector< ExpansionSharedPtr > ExpansionVector
Definition: Expansion.h:70
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual DNekMatSharedPtr v_BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
Definition: Expansion.cpp:305
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
Definition: Expansion.cpp:313
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int nmodes_offset, NekDouble *coeffs, std::vector< LibUtilities::BasisType > &fromType)
Definition: Expansion.cpp:320
void AddFaceNormBoundaryInt(const int face, const boost::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:134
The base class for all shapes.
Definition: StdExpansion.h:69
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:48
virtual void v_ComputeLaplacianMetric()
Definition: Expansion.h:141
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:227
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: Expansion.cpp:224
std::map< MetricType, Array< OneD, NekDouble > > MetricMap
Definition: Expansion.h:72
virtual DNekScalMatSharedPtr v_GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:181
void DGDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:143
double NekDouble
virtual const SpatialDomains::GeomFactorsSharedPtr & v_GetMetricInfo() const
Definition: Expansion.cpp:175
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
virtual void v_AddFaceNormBoundaryInt(const int face, const boost::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:349
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:85
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:161
boost::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
virtual void v_DGDeriv(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, ExpansionSharedPtr > &EdgeExp, Array< OneD, Array< OneD, NekDouble > > &coeffs, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:358
#define LOCAL_REGIONS_EXPORT
void AddEdgeNormBoundaryInt(const int edge, const boost::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:115
boost::shared_ptr< Geometry > GeometrySharedPtr
Definition: Geometry.h:53
virtual void v_AddEdgeNormBoundaryInt(const int edge, const boost::shared_ptr< Expansion > &EdgeExp, const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:330
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:228
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:253