Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TriGeom.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: TriGeom.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:
33 //
34 //
35 ////////////////////////////////////////////////////////////////////////////////
36 #ifndef NEKTAR_SPATIALDOMAINS_TRIGEOM_H
37 #define NEKTAR_SPATIALDOMAINS_TRIGEOM_H
38 
43 #include <SpatialDomains/SegGeom.h>
44 
46 #include <StdRegions/StdTriExp.h>
47 
48 namespace Nektar
49 {
50  namespace SpatialDomains
51  {
52  class TriGeom;
53  class SegGeom;
54  struct Curve;
55 
56  typedef boost::shared_ptr<Curve> CurveSharedPtr;
57  typedef boost::shared_ptr<SegGeom> SegGeomSharedPtr;
58  typedef boost::shared_ptr<TriGeom> TriGeomSharedPtr;
59  typedef std::vector< SegGeomSharedPtr > SegGeomVector;
60  typedef std::vector< TriGeomSharedPtr > TriGeomVector;
62  typedef std::map<int, TriGeomSharedPtr> TriGeomMap;
64 
65  class TriGeom: public Geometry2D
66  {
67  public:
69 
70  SPATIAL_DOMAINS_EXPORT TriGeom(int id, const int coordim);
71 
73  const int id,
74  const PointGeomSharedPtr verts[],
75  const SegGeomSharedPtr edges[],
76  const StdRegions::Orientation eorient[]);
77 
79  const int id,
80  const SegGeomSharedPtr edges[],
81  const StdRegions::Orientation eorient[]);
82 
84  const int id,
85  const SegGeomSharedPtr edges[],
86  const StdRegions::Orientation eorient[],
87  const CurveSharedPtr &curve);
88 
89  SPATIAL_DOMAINS_EXPORT TriGeom(const TriGeom &in);
90 
92 
94  const int i,
95  const Array<OneD, const NekDouble> &Lcoord);
96 
97  /// Get the orientation of face1.
98  SPATIAL_DOMAINS_EXPORT static const int kNedges = 3;
99  SPATIAL_DOMAINS_EXPORT static const int kNverts = 3;
100 
103  const TriGeom &face1,
104  const TriGeom &face2);
107  const PointGeomVector &face1,
108  const PointGeomVector &face2);
109 
110  protected:
114  int m_fid;
116  std::list<CompToElmt> m_elmtMap;
117 
119  int gvo_id,
120  int locid);
121 
122  SPATIAL_DOMAINS_EXPORT virtual int v_NumElmtConnected() const;
123 
125  int gvo_id,
126  int locid) const;
127 
128  SPATIAL_DOMAINS_EXPORT virtual int v_GetFid() const;
129 
130  SPATIAL_DOMAINS_EXPORT virtual int v_GetCoordim() const;
131 
133  v_GetBasis(const int i);
134 
136  v_GetEdgeBasis(const int i);
137 
139  const int i,
140  const Array<OneD,const NekDouble> &Lcoord);
141 
143 
144  SPATIAL_DOMAINS_EXPORT virtual void v_SetOwnData();
145 
146  /// Put all quadrature information into edge structure
147  SPATIAL_DOMAINS_EXPORT virtual void v_FillGeom();
148 
150  const Array<OneD,const NekDouble> &coords,
151  Array<OneD, NekDouble> &Lcoords);
152 
153  SPATIAL_DOMAINS_EXPORT virtual int v_GetEid(int i) const;
154 
155  SPATIAL_DOMAINS_EXPORT virtual int v_GetVid(int i) const;
156 
158  v_GetVertex(int i) const;
159 
161  v_GetEdge(int i) const;
162 
164  v_GetEorient(const int i) const;
165 
167  v_GetCartesianEorient(const int i) const;
168 
169  /// Return the edge number of the given edge
171  SegGeomSharedPtr edge);
172 
173  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumVerts() const;
174 
175  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumEdges() const;
176 
178  const Array<OneD, const NekDouble> &gloCoord,
179  NekDouble tol = 0.0);
180 
182  const Array<OneD, const NekDouble> &gloCoord,
183  Array<OneD, NekDouble> &locCoord,
184  NekDouble tol);
185 
187  const Array<OneD, const NekDouble> &gloCoord,
188  Array<OneD, NekDouble> &locCoord,
189  NekDouble tol,
190  NekDouble &resid);
191 
192  private:
193  bool m_ownData;
194  };
195 
196  }; //end of namespace SpatialDomains
197 }; //end of namespace Nektar
198 
199 #endif