Nektar++
QuadGeom.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: QuadGeom.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:
33 //
34 //
35 ////////////////////////////////////////////////////////////////////////////////
36 #ifndef NEKTAR_SPATIALDOMAINS_QUADGEOM_H
37 #define NEKTAR_SPATIALDOMAINS_QUADGEOM_H
38 
40 
44 #include <SpatialDomains/SegGeom.h> // for SegGeomSharedPtr, etc
45 
46 
47 namespace Nektar
48 {
49  namespace SpatialDomains
50  {
51  class QuadGeom;
52  struct Curve;
53  typedef boost::shared_ptr<Curve> CurveSharedPtr;
54  typedef boost::shared_ptr<QuadGeom> QuadGeomSharedPtr;
55  typedef std::vector< QuadGeomSharedPtr > QuadGeomVector;
57  typedef std::map<int, QuadGeomSharedPtr> QuadGeomMap;
59 
60  class QuadGeom: public Geometry2D
61  {
62  public:
64 
66  const int id,
67  const PointGeomSharedPtr verts[],
68  const SegGeomSharedPtr edges[],
69  const StdRegions::Orientation eorient[]);
70 
72  const int id,
73  const SegGeomSharedPtr edges[],
74  const StdRegions::Orientation eorient[]);
75 
77  const int id,
78  const SegGeomSharedPtr edges[],
79  const StdRegions::Orientation eorient[],
80  const CurveSharedPtr &curve);
81 
82  SPATIAL_DOMAINS_EXPORT QuadGeom(const QuadGeom &in);
83 
85 
87  const int i,
88  const Array<OneD, const NekDouble> &Lcoord);
89 
90  /// Get the orientation of face1.
93  const QuadGeom &face1,
94  const QuadGeom &face2);
97  const PointGeomVector &face1,
98  const PointGeomVector &face2);
99 
100  SPATIAL_DOMAINS_EXPORT static const int kNverts = 4;
101  SPATIAL_DOMAINS_EXPORT static const int kNedges = 4;
102  SPATIAL_DOMAINS_EXPORT static const std::string XMLElementType;
103 
104  protected:
108  int m_fid;
110  std::list<CompToElmt> m_elmtMap;
111  CurveSharedPtr m_curve;
112 
114  int gvo_id,
115  int locid);
116 
117  SPATIAL_DOMAINS_EXPORT virtual int v_NumElmtConnected() const;
118 
120  int gvo_id,
121  int locid) const;
122 
123  SPATIAL_DOMAINS_EXPORT virtual int v_GetFid() const;
124 
125  SPATIAL_DOMAINS_EXPORT virtual int v_GetCoordim() const;
126 
128  v_GetBasis(const int i);
129 
131  v_GetEdgeBasis(const int i);
132 
134  const int i,
135  const Array<OneD,const NekDouble> &Lcoord);
136 
138 
139  SPATIAL_DOMAINS_EXPORT virtual void v_SetOwnData();
140 
141  /// Put all quadrature information into edge structure
142  SPATIAL_DOMAINS_EXPORT virtual void v_FillGeom();
143 
145  const Array<OneD,const NekDouble> &coords,
146  Array<OneD,NekDouble> &Lcoords);
147 
148  SPATIAL_DOMAINS_EXPORT virtual int v_GetEid(int i) const;
149 
150  SPATIAL_DOMAINS_EXPORT virtual int v_GetVid(int i) const;
151 
153  v_GetVertex(int i) const;
154 
156  v_GetEdge(int i) const;
157 
159  v_GetEorient(const int i) const;
160 
162  v_GetCartesianEorient(const int i) const;
163 
164  /// Return the edge number of the given edge
166  SegGeomSharedPtr edge);
167 
168  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumVerts() const;
169 
170  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumEdges() const;
171 
173  const Array<OneD, const NekDouble> &gloCoord,
174  NekDouble tol = 0.0);
175 
177  const Array<OneD, const NekDouble> &gloCoord,
178  Array<OneD, NekDouble> &locCoord,
179  NekDouble tol);
180 
182  const Array<OneD, const NekDouble> &gloCoord,
183  Array<OneD, NekDouble> &locCoord,
184  NekDouble tol,
185  NekDouble &resid);
186 
187  SPATIAL_DOMAINS_EXPORT virtual void v_Reset(
188  CurveMap &curvedEdges,
189  CurveMap &curvedFaces);
190 
191  private:
192  /// Boolean indicating whether object owns the data
193  bool m_ownData;
194 
195  void SetUpXmap();
196  };
197 
198  }; //end of namespace
199 }; //end of namespace
200 
201 #endif //NEKTAR_SPATIALDOMAINS_QUADGEOM_H
virtual const Geometry1DSharedPtr v_GetEdge(int i) const
Definition: QuadGeom.cpp:710
virtual int v_GetCoordim() const
Definition: QuadGeom.cpp:405
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Definition: QuadGeom.cpp:792
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry3D.h:61
boost::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: QuadGeom.h:54
virtual int v_NumElmtConnected() const
Definition: QuadGeom.cpp:367
virtual PointGeomSharedPtr v_GetVertex(int i) const
Definition: QuadGeom.cpp:700
std::map< int, QuadGeomSharedPtr >::iterator QuadGeomMapIter
Definition: QuadGeom.h:58
std::vector< SegGeomSharedPtr > SegGeomVector
Definition: Geometry3D.h:65
boost::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:62
virtual bool v_IsElmtConnected(int gvo_id, int locid) const
Definition: QuadGeom.cpp:376
virtual int v_GetVid(int i) const
Definition: QuadGeom.cpp:690
virtual int v_GetNumEdges() const
Definition: QuadGeom.cpp:786
std::list< CompToElmt > m_elmtMap
Definition: QuadGeom.h:110
NekDouble GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Definition: QuadGeom.cpp:245
std::vector< SharedQuadGeomPtr > QuadGeomVector
Definition: MeshGraph2D.h:52
static StdRegions::Orientation GetFaceOrientation(const QuadGeom &face1, const QuadGeom &face2)
Get the orientation of face1.
Definition: QuadGeom.cpp:257
virtual NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Definition: QuadGeom.cpp:440
virtual void v_AddElmtConnected(int gvo_id, int locid)
Definition: QuadGeom.cpp:357
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state and remove allocated GeomFactors.
Definition: QuadGeom.cpp:827
virtual StdRegions::Orientation v_GetCartesianEorient(const int i) const
Definition: QuadGeom.cpp:730
virtual const LibUtilities::BasisSharedPtr v_GetEdgeBasis(const int i)
Definition: QuadGeom.cpp:423
virtual int v_GetNumVerts() const
Definition: QuadGeom.cpp:777
virtual int v_GetFid() const
Definition: QuadGeom.cpp:396
double NekDouble
virtual int v_WhichEdge(SegGeomSharedPtr edge)
Return the edge number of the given edge.
Definition: QuadGeom.cpp:754
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_FillGeom()
Put all quadrature information into edge structure.
Definition: QuadGeom.cpp:531
std::map< int, QuadGeomSharedPtr > QuadGeomMap
Definition: QuadGeom.h:57
2D geometry information
Definition: Geometry2D.h:65
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry1D.h:48
virtual int v_GetEid(int i) const
Definition: QuadGeom.cpp:680
boost::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:63
StdRegions::Orientation m_eorient[kNedges]
Definition: QuadGeom.h:107
bool m_ownData
Boolean indicating whether object owns the data.
Definition: QuadGeom.h:193
boost::shared_ptr< Basis > BasisSharedPtr
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Definition: QuadGeom.cpp:613
std::vector< QuadGeomSharedPtr >::iterator QuadGeomVectorIter
Definition: QuadGeom.h:56
virtual StdRegions::Orientation v_GetEorient(const int i) const
Definition: QuadGeom.cpp:720
virtual const LibUtilities::BasisSharedPtr v_GetBasis(const int i)
Definition: QuadGeom.cpp:414
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
#define SPATIAL_DOMAINS_EXPORT
static const std::string XMLElementType
Definition: QuadGeom.h:102