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 #ifndef NEKTAR_SPATIALDOMAINS_SEGGEOM_H
36 #define NEKTAR_SPATIALDOMAINS_SEGGEOM_H
37 
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 
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 
146  const int i,
147  const Array<OneD,const NekDouble> &Lcoord);
148 
149  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumVerts() const;
150 
151  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumEdges() const;
152 
154  const Array<OneD, const NekDouble>& gloCoord,
155  NekDouble tol = 0.0);
156 
158  const Array<OneD, const NekDouble> &gloCoord,
159  Array<OneD, NekDouble> &locCoord,
160  NekDouble tol);
161 
163  const Array<OneD, const NekDouble> &gloCoord,
164  Array<OneD, NekDouble> &locCoord,
165  NekDouble tol,
166  NekDouble &resid);
167  private:
168  /// Boolean indicating whether object owns the data
169  bool m_ownData;
170  };
171 
172 
173  }; //end of namespace
174 }; //end of namespace
175 
176 #endif //NEKTAR_SPATIALDOMAINS_SEGGEOM_H
177