Nektar++
Geometry2D.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: Geometry2D.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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: 2D geometry information
32 //
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H
37 #define NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H
38 
41 
44 
45 namespace Nektar
46 {
47 
48 namespace SpatialDomains
49 {
50 
51 class Geometry0D;
52 class Geometry1D;
53 class Geometry2D;
54 class PointGeom;
55 class SegGeom;
56 
57 // shorthand for boost pointer
58 typedef std::shared_ptr<PointGeom> PointGeomSharedPtr;
59 typedef std::shared_ptr<Geometry0D> Geometry0DSharedPtr;
60 typedef std::shared_ptr<Geometry1D> Geometry1DSharedPtr;
61 typedef std::shared_ptr<Geometry2D> Geometry2DSharedPtr;
62 typedef std::shared_ptr<SegGeom> SegGeomSharedPtr;
63 typedef std::vector<Geometry2DSharedPtr> Geometry2DVector;
64 typedef std::vector<PointGeomSharedPtr> PointGeomVector;
65 typedef std::vector<SegGeomSharedPtr> SegGeomVector;
66 
67 /// 2D geometry information
68 class Geometry2D : public Geometry
69 {
70 public:
72  SPATIAL_DOMAINS_EXPORT Geometry2D(const int coordim, CurveSharedPtr curve);
74 
75  SPATIAL_DOMAINS_EXPORT static const int kDim = 2;
76 
77 protected:
78  PointGeomVector m_verts;
79  SegGeomVector m_edges;
80  std::vector<StdRegions::Orientation> m_eorient;
82 
84  const Array<OneD, const NekDouble> &ptsx,
85  const Array<OneD, const NekDouble> &ptsy,
86  Array<OneD, NekDouble> &Lcoords,
87  NekDouble &resid);
88 
89 private:
90  //---------------------------------------
91  // Helper functions
92  //---------------------------------------
93  virtual int v_GetShapeDim() const;
94  virtual PointGeomSharedPtr v_GetVertex(int i) const;
95  virtual Geometry1DSharedPtr v_GetEdge(int i) const;
96  virtual int v_GetNumVerts() const;
97  virtual int v_GetNumEdges() const;
98  virtual StdRegions::Orientation v_GetEorient(const int i) const;
99 };
100 
101 }
102 }
103 
104 #endif // NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:65
Base class for shape geometry information.
Definition: Geometry.h:83
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry2D.h:64
virtual int v_GetShapeDim() const
Get the object&#39;s shape dimension.
Definition: Geometry2D.cpp:206
virtual Geometry1DSharedPtr v_GetEdge(int i) const
Returns edge i of this object.
Definition: Geometry2D.cpp:194
std::vector< SegGeomSharedPtr > SegGeomVector
Definition: Geometry2D.h:65
std::vector< StdRegions::Orientation > m_eorient
Definition: Geometry2D.h:80
void NewtonIterationForLocCoord(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, Array< OneD, NekDouble > &Lcoords, NekDouble &resid)
Definition: Geometry2D.cpp:65
double NekDouble
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
virtual StdRegions::Orientation v_GetEorient(const int i) const
Returns the orientation of edge i with respect to the ordering of edges in the standard element...
Definition: Geometry2D.cpp:200
2D geometry information
Definition: Geometry2D.h:68
virtual int v_GetNumVerts() const
Get the number of vertices of this object.
Definition: Geometry2D.cpp:178
std::shared_ptr< Geometry0D > Geometry0DSharedPtr
Definition: Geometry0D.h:45
std::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:61
std::vector< Geometry2DSharedPtr > Geometry2DVector
Definition: Geometry2D.h:63
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:63
virtual PointGeomSharedPtr v_GetVertex(int i) const
Definition: Geometry2D.cpp:188
virtual int v_GetNumEdges() const
Get the number of edges of this object.
Definition: Geometry2D.cpp:183
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62
#define SPATIAL_DOMAINS_EXPORT