Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_GetShapeDim() const;
109 
110  SPATIAL_DOMAINS_EXPORT virtual int v_GetVid(int i) const;
111 
113  v_GetVertex(const int i) const;
114 
115  SPATIAL_DOMAINS_EXPORT virtual int v_GetEid() const;
116 
118  v_GetBasis(const int i);
119 
120  SPATIAL_DOMAINS_EXPORT virtual
122 
123  SPATIAL_DOMAINS_EXPORT virtual void v_SetOwnData();
124 
125  SPATIAL_DOMAINS_EXPORT virtual void
126  v_AddElmtConnected(int gvo_id, int locid);
127 
128  SPATIAL_DOMAINS_EXPORT virtual int v_NumElmtConnected() const;
129 
130  SPATIAL_DOMAINS_EXPORT virtual bool
131  v_IsElmtConnected(int gvoId, int locId) const;
132 
134  v_DetShapeType() const;
135 
137  const Array<OneD, const NekDouble>& coords,
138  Array<OneD,NekDouble>& Lcoords);
139 
141 
143  v_GetPorient(const int i) const;
144 
145  SPATIAL_DOMAINS_EXPORT virtual void v_FillGeom ();
146 
147  SPATIAL_DOMAINS_EXPORT virtual void v_Reset(
148  CurveMap &curvedEdges,
149  CurveMap &curvedFaces);
150 
152  const int i,
153  const Array<OneD,const NekDouble> &Lcoord);
154 
155  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumVerts() const;
156 
157  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumEdges() const;
158 
160  const Array<OneD, const NekDouble>& gloCoord,
161  NekDouble tol = 0.0);
162 
164  const Array<OneD, const NekDouble> &gloCoord,
165  Array<OneD, NekDouble> &locCoord,
166  NekDouble tol);
167 
169  const Array<OneD, const NekDouble> &gloCoord,
170  Array<OneD, NekDouble> &locCoord,
171  NekDouble tol,
172  NekDouble &resid);
173  private:
174  /// Boolean indicating whether object owns the data
175  bool m_ownData;
177 
178  void SetUpXmap();
179  };
180  }; //end of namespace
181 }; //end of namespace
182 
183 #endif //NEKTAR_SPATIALDOMAINS_SEGGEOM_H
184 
virtual PointGeomSharedPtr v_GetVertex(const int i) const
Definition: SegGeom.cpp:497
virtual int v_GetNumVerts() const
Definition: SegGeom.cpp:556
bool m_ownData
Boolean indicating whether object owns the data.
Definition: SegGeom.h:175
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:525
virtual int v_GetNumEdges() const
Definition: SegGeom.cpp:561
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:535
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:551
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:520
boost::shared_ptr< StdExpansion1D > StdExpansion1DSharedPtr
double NekDouble
SpatialDomains::PointGeomSharedPtr m_verts[kNverts]
Definition: SegGeom.h:104
StdRegions::StdExpansion1DSharedPtr operator[](const int i) const
virtual int v_GetShapeDim() const
Definition: SegGeom.cpp:515
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