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 // 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: Segment geometry information
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SPATIALDOMAINS_SEGGEOM_H
37 #define NEKTAR_SPATIALDOMAINS_SEGGEOM_H
38 
43 #include <SpatialDomains/Curve.hpp>
45 
46 namespace Nektar
47 {
48  namespace SpatialDomains
49  {
50  class SegGeom;
51  typedef boost::shared_ptr<SegGeom> SegGeomSharedPtr;
52  typedef std::vector< SegGeomSharedPtr > SegGeomVector;
54  typedef std::map<int, SegGeomSharedPtr> SegGeomMap;
55 
56 
57  class SegGeom: public Geometry1D
58  {
59  public:
61 
62  SPATIAL_DOMAINS_EXPORT SegGeom(int id, const int coordim);
63 
65  int id,
66  const int coordim,
67  const PointGeomSharedPtr vertex[]);
68 
70  int id,
71  const int coordim,
72  const PointGeomSharedPtr vertex[],
73  const CurveSharedPtr &curve);
74 
76  const int id,
77  const PointGeomSharedPtr& vert1,
78  const PointGeomSharedPtr& vert2);
79 
80  SPATIAL_DOMAINS_EXPORT SegGeom(const SegGeom &in);
81 
82  SPATIAL_DOMAINS_EXPORT SegGeomSharedPtr GenerateOneSpaceDimGeom(void);
83 
85 
87  const int i,
88  const Array<OneD, const NekDouble> &Lcoord);
89 
91  GetEdgeOrientation(const SegGeom& edge1,
92  const SegGeom& edge2);
93 
95  operator[](const int i) const;
96 
97 
98  SPATIAL_DOMAINS_EXPORT static const int kNverts = 2;
99  SPATIAL_DOMAINS_EXPORT static const int kNedges = 1;
100 
101  protected:
102  int m_eid;
103  std::list<CompToElmt> m_elmtMap;
106 
107 
108  SPATIAL_DOMAINS_EXPORT virtual int v_GetVid(int i) const;
109 
111  v_GetVertex(const int i) const;
112 
113  SPATIAL_DOMAINS_EXPORT virtual int v_GetEid() const;
114 
116  v_GetBasis(const int i);
117 
118  SPATIAL_DOMAINS_EXPORT virtual
120 
121  SPATIAL_DOMAINS_EXPORT virtual void v_SetOwnData();
122 
123  SPATIAL_DOMAINS_EXPORT virtual void
124  v_AddElmtConnected(int gvo_id, int locid);
125 
126  SPATIAL_DOMAINS_EXPORT virtual int v_NumElmtConnected() const;
127 
128  SPATIAL_DOMAINS_EXPORT virtual bool
129  v_IsElmtConnected(int gvoId, int locId) const;
130 
132  v_DetShapeType() const;
133 
135  const Array<OneD, const NekDouble>& coords,
136  Array<OneD,NekDouble>& Lcoords);
137 
139 
141  v_GetPorient(const int i) const;
142 
143  SPATIAL_DOMAINS_EXPORT virtual void v_FillGeom ();
144 
145  SPATIAL_DOMAINS_EXPORT virtual void v_Reset(
146  CurveMap &curvedEdges,
147  CurveMap &curvedFaces);
148 
150  const int i,
151  const Array<OneD,const NekDouble> &Lcoord);
152 
153  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumVerts() const;
154 
155  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumEdges() const;
156 
158  const Array<OneD, const NekDouble>& gloCoord,
159  NekDouble tol = 0.0);
160 
162  const Array<OneD, const NekDouble> &gloCoord,
163  Array<OneD, NekDouble> &locCoord,
164  NekDouble tol);
165 
167  const Array<OneD, const NekDouble> &gloCoord,
168  Array<OneD, NekDouble> &locCoord,
169  NekDouble tol,
170  NekDouble &resid);
171  private:
172  /// Boolean indicating whether object owns the data
173  bool m_ownData;
175 
176  void SetUpXmap();
177  };
178  }; //end of namespace
179 }; //end of namespace
180 
181 #endif //NEKTAR_SPATIALDOMAINS_SEGGEOM_H
182 
virtual PointGeomSharedPtr v_GetVertex(const int i) const
Definition: SegGeom.cpp:497
virtual int v_GetNumVerts() const
Definition: SegGeom.cpp:550
bool m_ownData
Boolean indicating whether object owns the data.
Definition: SegGeom.h:173
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Definition: SegGeom.cpp:419
virtual StdRegions::StdExpansionSharedPtr v_GetXmap() const
Definition: SegGeom.cpp:519
virtual int v_GetNumEdges() const
Definition: SegGeom.cpp:555
StdRegions::Orientation m_porient[kNverts]
Definition: SegGeom.h:105
virtual bool v_IsElmtConnected(int gvoId, int locId) const
Definition: SegGeom.cpp:260
std::vector< SegGeomSharedPtr > SegGeomVector
Definition: Geometry3D.h:65
virtual StdRegions::Orientation v_GetPorient(const int i) const
Definition: SegGeom.cpp:529
static StdRegions::Orientation GetEdgeOrientation(const SegGeom &edge1, const SegGeom &edge2)
Get the orientation of edge1.
Definition: SegGeom.cpp:293
boost::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:62
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:175
virtual LibUtilities::ShapeType v_DetShapeType() const
Definition: SegGeom.cpp:545
virtual void v_GenGeomFactors()
Set up GeoFac for this geometry using Coord quadrature distribution.
Definition: SegGeom.cpp:319
NekDouble GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
static const int kNedges
Definition: SegGeom.h:99
virtual int v_NumElmtConnected() const
Definition: SegGeom.cpp:255
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
std::map< int, SegGeomSharedPtr > SegGeomMap
Definition: SegGeom.h:54
virtual const LibUtilities::BasisSharedPtr v_GetBasis(const int i)
Definition: SegGeom.cpp:514
boost::shared_ptr< StdExpansion1D > StdExpansion1DSharedPtr
double NekDouble
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
StdRegions::StdExpansion1DSharedPtr operator[](const int i) const
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
1D geometry information
Definition: Geometry1D.h:56
std::vector< SegGeomSharedPtr >::iterator SegGeomVectorIter
Definition: SegGeom.h:53
std::list< CompToElmt > m_elmtMap
Definition: SegGeom.h:103
virtual NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Definition: SegGeom.cpp:236
virtual void v_FillGeom()
put all quadrature information into edge structure and backward transform
Definition: SegGeom.cpp:341
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0)
Determines if a point specified in global coordinates is located within this tetrahedral geometry...
Definition: SegGeom.cpp:460
boost::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:63
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state and remove allocated GeomFactors.
Definition: SegGeom.cpp:404
virtual void v_AddElmtConnected(int gvo_id, int locid)
Definition: SegGeom.cpp:249
virtual int v_GetEid() const
Definition: SegGeom.cpp:509
boost::shared_ptr< Basis > BasisSharedPtr
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
#define SPATIAL_DOMAINS_EXPORT
static const int kNverts
Definition: SegGeom.h:98
virtual int v_GetVid(int i) const
Definition: SegGeom.cpp:491