Nektar++
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);
100 
102  const int edge,
103  const boost::shared_ptr<Expansion> &EdgeExp,
106  Array<OneD, NekDouble> &outarray);
108  const int edge,
109  const boost::shared_ptr<Expansion> &EdgeExp,
111  Array<OneD, NekDouble> &outarray);
113  const int face,
114  const boost::shared_ptr<Expansion> &FaceExp,
116  Array<OneD, NekDouble> &outarray);
118  const int dir,
119  const Array<OneD, const NekDouble>& inarray,
121  Array<OneD, Array<OneD, NekDouble> > &coeffs,
122  Array<OneD, NekDouble> &outarray);
123 
124  protected:
127  MetricMap m_metrics;
128 
129  void ComputeLaplacianMetric();
131 
132  virtual void v_MultiplyByQuadratureMetric(
133  const Array<OneD, const NekDouble> &inarray,
134  Array<OneD, NekDouble> &outarray);
135 
136  virtual void v_ComputeLaplacianMetric() {};
137 
138  virtual void v_GetCoords(Array<OneD,NekDouble> &coords_1,
139  Array<OneD,NekDouble> &coords_2,
140  Array<OneD,NekDouble> &coords_3);
141 
143 
145  const DNekScalMatSharedPtr &r_bnd,
146  const StdRegions::MatrixType matrixType);
147 
149  const DNekScalMatSharedPtr &r_bnd);
150 
151  virtual void v_AddEdgeNormBoundaryInt(
152  const int edge,
153  const boost::shared_ptr<Expansion> &EdgeExp,
156  Array<OneD, NekDouble> &outarray);
157  virtual void v_AddEdgeNormBoundaryInt(
158  const int edge,
159  const boost::shared_ptr<Expansion> &EdgeExp,
161  Array<OneD, NekDouble> &outarray);
162  virtual void v_AddFaceNormBoundaryInt(
163  const int face,
164  const boost::shared_ptr<Expansion> &FaceExp,
166  Array<OneD, NekDouble> &outarray);
167  virtual void v_DGDeriv(
168  const int dir,
169  const Array<OneD, const NekDouble>& inarray,
171  Array<OneD, Array<OneD, NekDouble> > &coeffs,
172  Array<OneD, NekDouble> &outarray);
173 
174  private:
175 
176  };
177  } //end of namespace
178 } //end of namespace
179 
180 #endif
boost::weak_ptr< Expansion > ExpansionWeakPtr
Definition: Expansion.h:69
DNekMatSharedPtr BuildTransformationMatrix(const DNekScalMatSharedPtr &r_bnd, const StdRegions::MatrixType matrixType)
Definition: Expansion.cpp:88
virtual void v_MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:174
SpatialDomains::GeomFactorsSharedPtr m_metricinfo
Definition: Expansion.h:126
DNekMatSharedPtr BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
Definition: Expansion.cpp:96
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:248
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:125
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:292
virtual DNekMatSharedPtr v_BuildVertexMatrix(const DNekScalMatSharedPtr &r_bnd)
Definition: Expansion.cpp:300
void AddFaceNormBoundaryInt(const int face, const boost::shared_ptr< Expansion > &FaceExp, const Array< OneD, const NekDouble > &Fn, Array< OneD, NekDouble > &outarray)
Definition: Expansion.cpp:121
The base class for all shapes.
Definition: StdExpansion.h:69
Expansion(SpatialDomains::GeometrySharedPtr pGeom)
Definition: Expansion.cpp:46
virtual void v_ComputeLaplacianMetric()
Definition: Expansion.h:136
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:225
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: Expansion.cpp:211
std::map< MetricType, Array< OneD, NekDouble > > MetricMap
Definition: Expansion.h:72
virtual DNekScalMatSharedPtr v_GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:168
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:130
virtual const SpatialDomains::GeomFactorsSharedPtr & v_GetMetricInfo() const
Definition: Expansion.cpp:162
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:326
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
DNekScalMatSharedPtr GetLocMatrix(const LocalRegions::MatrixKey &mkey)
Definition: Expansion.cpp:83
SpatialDomains::GeometrySharedPtr GetGeom() const
Definition: Expansion.cpp:148
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:335
boost::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
#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:102
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:307
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:226
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:249