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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description:
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SPATIALDOMAINS_TRIGEOM_H
36 #define NEKTAR_SPATIALDOMAINS_TRIGEOM_H
37 
42 #include <SpatialDomains/SegGeom.h>
43 
45 #include <StdRegions/StdTriExp.h>
46 
47 namespace Nektar
48 {
49 namespace SpatialDomains
50 {
51 
52 class TriGeom;
53 class SegGeom;
54 struct Curve;
55 
56 typedef std::shared_ptr<Curve> CurveSharedPtr;
57 typedef std::shared_ptr<SegGeom> SegGeomSharedPtr;
58 typedef std::shared_ptr<TriGeom> TriGeomSharedPtr;
59 typedef std::map<int, TriGeomSharedPtr> TriGeomMap;
60 
61 class TriGeom : public Geometry2D
62 {
63 public:
67  const int id,
68  const SegGeomSharedPtr edges[],
69  const CurveSharedPtr curve = CurveSharedPtr());
71 
72  /// Get the orientation of face1.
73  SPATIAL_DOMAINS_EXPORT static const int kNedges = 3;
74  SPATIAL_DOMAINS_EXPORT static const int kNverts = 3;
75 
77  const TriGeom &face1, const TriGeom &face2,
78  bool doRot, int dir, NekDouble angle, NekDouble tol);
79 
81  const PointGeomVector &face1, const PointGeomVector &face2,
82  bool doRot, int dir, NekDouble angle, NekDouble tol);
83 
84 protected:
86  const int i, const Array<OneD, const NekDouble> &Lcoord);
87 
89  SPATIAL_DOMAINS_EXPORT virtual void v_FillGeom();
90  SPATIAL_DOMAINS_EXPORT virtual int v_GetDir(const int faceidx, const int facedir) const;
91 
92  SPATIAL_DOMAINS_EXPORT virtual void v_Reset(CurveMap &curvedEdges,
93  CurveMap &curvedFaces);
94  SPATIAL_DOMAINS_EXPORT virtual void v_Setup();
95 
96 private:
97  void SetUpXmap();
98 };
99 
100 }
101 }
102 
103 #endif
#define SPATIAL_DOMAINS_EXPORT
2D geometry information
Definition: Geometry2D.h:69
static const int kNedges
Get the orientation of face1.
Definition: TriGeom.h:73
static StdRegions::Orientation GetFaceOrientation(const TriGeom &face1, const TriGeom &face2, bool doRot, int dir, NekDouble angle, NekDouble tol)
Definition: TriGeom.cpp:118
virtual NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Given local collapsed coordinate Lcoord, return the value of physical coordinate in direction i.
Definition: TriGeom.cpp:107
virtual int v_GetDir(const int faceidx, const int facedir) const
Returns the element coordinate direction corresponding to a given face coordinate direction.
Definition: TriGeom.cpp:476
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
Definition: TriGeom.cpp:483
virtual void v_GenGeomFactors()
Definition: TriGeom.cpp:226
static const int kNverts
Definition: TriGeom.h:74
std::map< int, TriGeomSharedPtr > TriGeomMap
Definition: TriGeom.h:59
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry2D.h:64
std::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:61
std::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:62
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62
std::shared_ptr< TriGeom > TriGeomSharedPtr
Definition: TriGeom.h:58
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble