Nektar++
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:
112  SegGeomVector m_edges;
114  int m_fid;
116  std::list<CompToElmt> m_elmtMap;
117  CurveSharedPtr m_curve;
118 
120  int gvo_id,
121  int locid);
122 
123  SPATIAL_DOMAINS_EXPORT virtual int v_NumElmtConnected() const;
124 
126  int gvo_id,
127  int locid) const;
128 
129  SPATIAL_DOMAINS_EXPORT virtual int v_GetFid() const;
130 
131  SPATIAL_DOMAINS_EXPORT virtual int v_GetCoordim() const;
132 
134  v_GetBasis(const int i);
135 
137  v_GetEdgeBasis(const int i);
138 
140  const int i,
141  const Array<OneD,const NekDouble> &Lcoord);
142 
144 
145  SPATIAL_DOMAINS_EXPORT virtual void v_SetOwnData();
146 
147  /// Put all quadrature information into edge structure
148  SPATIAL_DOMAINS_EXPORT virtual void v_FillGeom();
149 
151  const Array<OneD,const NekDouble> &coords,
152  Array<OneD, NekDouble> &Lcoords);
153 
154  SPATIAL_DOMAINS_EXPORT virtual int v_GetEid(int i) const;
155 
156  SPATIAL_DOMAINS_EXPORT virtual int v_GetVid(int i) const;
157 
159  v_GetVertex(int i) const;
160 
162  v_GetEdge(int i) const;
163 
165  v_GetEorient(const int i) const;
166 
168  v_GetCartesianEorient(const int i) const;
169 
170  /// Return the edge number of the given edge
172  SegGeomSharedPtr edge);
173 
174  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumVerts() const;
175 
176  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumEdges() const;
177 
179  const Array<OneD, const NekDouble> &gloCoord,
180  NekDouble tol = 0.0);
181 
183  const Array<OneD, const NekDouble> &gloCoord,
184  Array<OneD, NekDouble> &locCoord,
185  NekDouble tol);
186 
188  const Array<OneD, const NekDouble> &gloCoord,
189  Array<OneD, NekDouble> &locCoord,
190  NekDouble tol,
191  NekDouble &resid);
192 
193  SPATIAL_DOMAINS_EXPORT virtual void v_Reset(
194  CurveMap &curvedEdges,
195  CurveMap &curvedFaces);
196 
197  private:
198  bool m_ownData;
199 
200  void SetUpXmap();
201  };
202  }; //end of namespace SpatialDomains
203 }; //end of namespace Nektar
204 
205 #endif
virtual int v_NumElmtConnected() const
Definition: TriGeom.cpp:334
virtual int v_GetFid() const
Definition: TriGeom.cpp:358
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry3D.h:61
static const int kNverts
Definition: TriGeom.h:99
virtual void v_GenGeomFactors()
Definition: TriGeom.cpp:412
std::vector< SegGeomSharedPtr > SegGeomVector
Definition: Geometry3D.h:65
virtual void v_FillGeom()
Put all quadrature information into edge structure.
Definition: TriGeom.cpp:451
boost::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:62
std::map< int, TriGeomSharedPtr >::iterator TriGeomMapIter
Definition: TriGeom.h:63
StdRegions::Orientation m_eorient[kNedges]
Definition: TriGeom.h:113
std::map< int, TriGeomSharedPtr > TriGeomMap
Definition: TriGeom.h:62
std::vector< TriGeomSharedPtr >::iterator TriGeomVectorIter
Definition: TriGeom.h:61
virtual PointGeomSharedPtr v_GetVertex(int i) const
Definition: TriGeom.cpp:696
virtual StdRegions::Orientation v_GetEorient(const int i) const
Definition: TriGeom.cpp:716
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
std::list< CompToElmt > m_elmtMap
Definition: TriGeom.h:116
virtual const LibUtilities::BasisSharedPtr v_GetEdgeBasis(const int i)
Definition: TriGeom.cpp:385
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Definition: TriGeom.cpp:605
virtual void v_AddElmtConnected(int gvo_id, int locid)
Definition: TriGeom.cpp:324
virtual int v_GetVid(int i) const
Definition: TriGeom.cpp:686
double NekDouble
virtual int v_GetCoordim() const
Definition: TriGeom.cpp:367
virtual NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Definition: TriGeom.cpp:403
static const int kNedges
Get the orientation of face1.
Definition: TriGeom.h:98
virtual const LibUtilities::BasisSharedPtr v_GetBasis(const int i)
Definition: TriGeom.cpp:376
NekDouble GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Definition: TriGeom.cpp:224
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual StdRegions::Orientation v_GetCartesianEorient(const int i) const
Definition: TriGeom.cpp:726
virtual int v_WhichEdge(SegGeomSharedPtr edge)
Return the edge number of the given edge.
Definition: TriGeom.cpp:750
2D geometry information
Definition: Geometry2D.h:65
virtual int v_GetEid(int i) const
Definition: TriGeom.cpp:676
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry1D.h:48
boost::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
static StdRegions::Orientation GetFaceOrientation(const TriGeom &face1, const TriGeom &face2)
Definition: TriGeom.cpp:236
std::vector< TriGeomSharedPtr > TriGeomVector
Definition: TriGeom.h:60
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: TriGeom.cpp:792
boost::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:63
virtual int v_GetNumEdges() const
Definition: TriGeom.cpp:782
virtual int v_GetNumVerts() const
Definition: TriGeom.cpp:773
boost::shared_ptr< Basis > BasisSharedPtr
virtual bool v_IsElmtConnected(int gvo_id, int locid) const
Definition: TriGeom.cpp:343
virtual const Geometry1DSharedPtr v_GetEdge(int i) const
Definition: TriGeom.cpp:706
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
#define SPATIAL_DOMAINS_EXPORT
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state and remove allocated GeomFactors.
Definition: TriGeom.cpp:828