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 // 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;
77  SPATIAL_DOMAINS_EXPORT const Geometry1DSharedPtr
78  GetEdge(int i) const;
79  SPATIAL_DOMAINS_EXPORT const Geometry2DSharedPtr
80  GetFace(int i) const;
81 
82  SPATIAL_DOMAINS_EXPORT int WhichEdge(SegGeomSharedPtr edge);
83  SPATIAL_DOMAINS_EXPORT int WhichFace(Geometry2DSharedPtr face);
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
int WhichEdge(SegGeomSharedPtr edge)
Definition: Geometry2D.cpp:90
Base class for shape geometry information.
Definition: Geometry.h:76
virtual int v_WhichFace(Geometry2DSharedPtr face)
Definition: Geometry2D.cpp:286
const LibUtilities::BasisSharedPtr GetEdgeBasis(const int i)
Definition: Geometry2D.cpp:65
StdRegions::Orientation GetCartesianEorient(const int i) const
Definition: Geometry2D.cpp:85
virtual int v_GetFid(int i) const
Definition: Geometry.cpp:148
const Geometry2DSharedPtr GetFace(int i) const
Definition: Geometry2D.cpp:70
virtual int v_WhichEdge(SegGeomSharedPtr edge)
Definition: Geometry2D.cpp:279
virtual PointGeomSharedPtr v_GetVertex(int i) const
Definition: Geometry2D.cpp:242
virtual int v_GetShapeDim() const
Definition: Geometry2D.cpp:293
virtual StdRegions::Orientation v_GetCartesianEorient(const int i) const
Definition: Geometry2D.cpp:272
virtual const LibUtilities::BasisSharedPtr v_GetEdgeBasis(const int i)
Definition: Geometry2D.cpp:218
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
virtual StdRegions::Orientation v_GetEorient(const int i) const
Definition: Geometry2D.cpp:250
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:100
double NekDouble
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Definition: Geometry2D.cpp:298
StdRegions::Orientation GetFaceOrient(const int i) const
Definition: Geometry2D.cpp:75
int WhichFace(Geometry2DSharedPtr face)
Definition: Geometry2D.cpp:95
boost::shared_ptr< Geometry0D > Geometry0DSharedPtr
Definition: Geometry0D.h:46
boost::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry2D.h:59
virtual StdRegions::Orientation v_GetFaceOrient(const int i) const
Definition: Geometry2D.cpp:265
virtual const Geometry2DSharedPtr v_GetFace(int i) const
Definition: Geometry2D.cpp:257
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
2D geometry information
Definition: Geometry2D.h:65
const Geometry1DSharedPtr GetEdge(int i) const
Definition: Geometry2D.cpp:80
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry1D.h:48
std::vector< Geometry2DSharedPtr > Geometry2DVector
Definition: Geometry2D.h:61
virtual const Geometry1DSharedPtr v_GetEdge(int i) const
Definition: Geometry2D.cpp:234
boost::shared_ptr< Basis > BasisSharedPtr
std::vector< Geometry2DSharedPtr >::iterator Geometry2DVectorIter
Definition: Geometry2D.h:62
virtual int v_GetEid(int i) const
Definition: Geometry2D.cpp:227
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
#define SPATIAL_DOMAINS_EXPORT