Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 // 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: 2D geometry information
33 //
34 //
35 ////////////////////////////////////////////////////////////////////////////////
36 #ifndef NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H
37 #define NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H
38 
40 #include <StdRegions/StdExpansion2D.h> // for StdExpansion2DSharedPtr, etc
41 
44 
45 namespace Nektar
46 {
47  namespace SpatialDomains
48  {
49  class Geometry0D;
50  class Geometry1D;
51  class Geometry2D;
52  class PointGeom;
53  class SegGeom;
54 
55  // shorthand for boost pointer
56  typedef boost::shared_ptr<PointGeom> PointGeomSharedPtr;
57  typedef boost::shared_ptr<Geometry0D> Geometry0DSharedPtr;
58  typedef boost::shared_ptr<Geometry1D> Geometry1DSharedPtr;
59  typedef boost::shared_ptr<Geometry2D> Geometry2DSharedPtr;
60  typedef boost::shared_ptr<SegGeom> SegGeomSharedPtr;
61  typedef std::vector< Geometry2DSharedPtr > Geometry2DVector;
63 
64  /// 2D geometry information
65  class Geometry2D: public Geometry
66  {
67  public:
69  SPATIAL_DOMAINS_EXPORT Geometry2D(const int coordim);
71 
72  //---------------------------------------
73  // Helper functions
74  //---------------------------------------
75 
76  SPATIAL_DOMAINS_EXPORT int GetFid() const;
78  GetEdge(int i) const;
80  GetFace(int i) const;
81 
84 
86  GetEdgeBasis(const int i);
87 
88  //---------------------------------------
89  // Orientation functions
90  //---------------------------------------
91 
93  GetFaceOrient(const int i) const;
95  GetCartesianEorient(const int i) const;
96 
97 
98  protected:
100  const Array<OneD, const NekDouble> &coords,
101  const Array<OneD, const NekDouble> &ptsx,
102  const Array<OneD, const NekDouble> &ptsy,
103  Array<OneD, NekDouble> &Lcoords,
104  NekDouble &resid);
105 
106 
107  private:
108  //---------------------------------------
109  // Helper functions
110  //---------------------------------------
111 
112  using Geometry::v_GetFid;
113 
114  virtual int v_GetShapeDim() const;
115  virtual int v_GetFid() const;
116  virtual int v_GetEid(int i) const;
117  virtual PointGeomSharedPtr v_GetVertex(int i) const;
118  virtual const Geometry1DSharedPtr v_GetEdge(int i) const;
119  virtual const Geometry2DSharedPtr v_GetFace(int i) const;
120  virtual StdRegions::Orientation v_GetFaceOrient(const int i) const;
121  virtual StdRegions::Orientation v_GetEorient(const int i) const;
122  virtual StdRegions::Orientation v_GetCartesianEorient(const int i) const;
123  virtual int v_WhichEdge(SegGeomSharedPtr edge);
124  virtual int v_WhichFace(Geometry2DSharedPtr face);
125 
126  virtual const LibUtilities::BasisSharedPtr
127  v_GetEdgeBasis(const int i);
128  virtual bool v_ContainsPoint(
129  const Array<OneD, const NekDouble>& gloCoord,
130  NekDouble tol = 0.0);
131 
132  };
133 
134 
135  }; //end of namespace
136 }; //end of namespace
137 
138 #endif //NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H