Nektar++
SegGeom.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: SegGeom.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: Segment geometry information
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SPATIALDOMAINS_SEGGEOM_H
36 #define NEKTAR_SPATIALDOMAINS_SEGGEOM_H
37 
42 #include <SpatialDomains/Curve.hpp>
44 
45 namespace Nektar
46 {
47 
48 namespace SpatialDomains
49 {
50 class SegGeom;
51 typedef std::shared_ptr<SegGeom> SegGeomSharedPtr;
52 typedef std::map<int, SegGeomSharedPtr> SegGeomMap;
53 
54 class SegGeom : public Geometry1D
55 {
56 public:
59  int id,
60  const int coordim,
61  const PointGeomSharedPtr vertex[],
62  const CurveSharedPtr curve = CurveSharedPtr());
63 
64  SPATIAL_DOMAINS_EXPORT SegGeom(const SegGeom &in);
65 
66  SPATIAL_DOMAINS_EXPORT SegGeomSharedPtr GenerateOneSpaceDimGeom(void);
67 
69 
71  const SegGeom &edge1, const SegGeom &edge2);
72 
74  {
75  return m_curve;
76  }
77 
78  SPATIAL_DOMAINS_EXPORT static const int kNverts = 2;
79  SPATIAL_DOMAINS_EXPORT static const int kNedges = 1;
80 
81 protected:
84 
85  virtual PointGeomSharedPtr v_GetVertex(const int i) const;
87  virtual NekDouble v_GetLocCoords(
88  const Array<OneD, const NekDouble> &coords,
89  Array<OneD, NekDouble> &Lcoords);
90  virtual void v_GenGeomFactors();
91  virtual void v_FillGeom();
92  virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces);
93  virtual void v_Setup();
94 
95  virtual NekDouble v_GetCoord(
96  const int i, const Array<OneD, const NekDouble> &Lcoord);
97  virtual int v_GetNumVerts() const;
98  virtual int v_GetNumEdges() const;
99  virtual bool v_ContainsPoint(
100  const Array<OneD, const NekDouble> &gloCoord,
101  Array<OneD, NekDouble> &locCoord,
102  NekDouble tol,
103  NekDouble &resid);
104 
105 private:
106  /// Boolean indicating whether object owns the data
108 
109  void SetUpXmap();
110 };
111 } // end of namespace
112 } // end of namespace
113 
114 #endif // NEKTAR_SPATIALDOMAINS_SEGGEOM_H
virtual PointGeomSharedPtr v_GetVertex(const int i) const
Definition: SegGeom.cpp:400
CurveSharedPtr GetCurve()
Definition: SegGeom.h:73
std::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:62
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this ge...
Definition: SegGeom.cpp:339
StdRegions::Orientation m_porient[kNverts]
Definition: SegGeom.h:83
static StdRegions::Orientation GetEdgeOrientation(const SegGeom &edge1, const SegGeom &edge2)
Get the orientation of edge1.
Definition: SegGeom.cpp:200
virtual int v_GetNumVerts() const
Get the number of vertices of this object.
Definition: SegGeom.cpp:412
SegGeomSharedPtr GenerateOneSpaceDimGeom(void)
Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] ...
Definition: SegGeom.cpp:111
virtual void v_GenGeomFactors()
Definition: SegGeom.cpp:224
static const int kNedges
Definition: SegGeom.h:79
std::map< int, SegGeomSharedPtr > SegGeomMap
Definition: SegGeom.h:52
double NekDouble
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:82
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
Definition: SegGeom.cpp:372
virtual LibUtilities::ShapeType v_GetShapeType() const
Definition: SegGeom.cpp:169
1D geometry information
Definition: Geometry1D.h:54
CurveSharedPtr m_curve
Boolean indicating whether object owns the data.
Definition: SegGeom.h:107
std::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:61
virtual int v_GetNumEdges() const
Get the number of edges of this object.
Definition: SegGeom.cpp:417
virtual NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Given local collapsed coordinate Lcoord, return the value of physical coordinate in direction i...
Definition: SegGeom.cpp:174
virtual void v_FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements...
Definition: SegGeom.cpp:247
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
Definition: SegGeom.cpp:315
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62
#define SPATIAL_DOMAINS_EXPORT
static const int kNverts
Definition: SegGeom.h:78