Nektar++
Loading...
Searching...
No Matches
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
43
46
48{
49
50class TriGeom;
51class SegGeom;
52struct Curve;
53
54class TriGeom : public Geometry2D
55{
56public:
57 SPATIAL_DOMAINS_EXPORT static const int kNedges = 3;
58 SPATIAL_DOMAINS_EXPORT static const int kNverts = 3;
60
64 std::array<SegGeom *, kNedges> edges,
65 Curve *curve = nullptr);
66 SPATIAL_DOMAINS_EXPORT ~TriGeom() override = default;
67
68 /// Get the orientation of face1.
70 const TriGeom &face1, const TriGeom &face2, bool doRot, int dir,
71 NekDouble angle, NekDouble tol);
72
74 std::array<PointGeom *, kNedges> face1,
75 std::array<PointGeom *, kNedges> face2, bool doRot, int dir,
76 NekDouble angle, NekDouble tol);
77
78protected:
80 const int i, const Array<OneD, const NekDouble> &Lcoord) override;
81 GeomType v_CalcGeomType() override;
83 LibUtilities::PointsKeyVector &keyTgt) override;
84 SPATIAL_DOMAINS_EXPORT void v_FillGeom() override;
85 SPATIAL_DOMAINS_EXPORT int v_GetDir(const int faceidx,
86 const int facedir) const override;
87 SPATIAL_DOMAINS_EXPORT void v_Reset(CurveMap &curvedEdges,
88 CurveMap &curvedFaces) override;
89
90 SPATIAL_DOMAINS_EXPORT void v_Setup() override;
91
92 int v_AllLeftCheck(const Array<OneD, const NekDouble> &gloCoord) override;
93
94 inline int v_GetNumVerts() const final
95 {
96 return kNverts;
97 }
98
99 inline int v_GetNumEdges() const final
100 {
101 return kNedges;
102 }
103
104 inline PointGeom *v_GetVertex(const int i) const final
105 {
106 return m_verts[i];
107 }
108
109 inline Geometry1D *v_GetEdge(const int i) const final
110 {
111 return static_cast<Geometry1D *>(m_edges[i]);
112 }
113
114 inline StdRegions::Orientation v_GetEorient(const int i) const final
115 {
116 return m_eorient[i];
117 }
118
119 std::array<PointGeom *, kNverts> m_verts;
120 std::array<SegGeom *, kNedges> m_edges;
121 std::array<StdRegions::Orientation, kNedges> m_eorient;
122
123private:
124 void SetUpXmap();
125};
126
127} // namespace Nektar::SpatialDomains
128
129#endif
#define SPATIAL_DOMAINS_EXPORT
1D geometry information
Definition Geometry1D.h:49
2D geometry information
Definition Geometry2D.h:50
static const int kNedges
Definition TriGeom.h:57
static const int kNfacets
Definition TriGeom.h:59
static StdRegions::Orientation GetFaceOrientation(std::array< PointGeom *, kNedges > face1, std::array< PointGeom *, kNedges > face2, bool doRot, int dir, NekDouble angle, NekDouble tol)
StdRegions::Orientation v_GetEorient(const int i) const final
Returns the orientation of edge i with respect to the ordering of edges in the standard element.
Definition TriGeom.h:114
std::array< PointGeom *, kNverts > m_verts
Definition TriGeom.h:119
int v_GetDir(const int faceidx, const int facedir) const override
Returns the element coordinate direction corresponding to a given face coordinate direction.
Definition TriGeom.cpp:612
static StdRegions::Orientation GetFaceOrientation(const TriGeom &face1, const TriGeom &face2, bool doRot, int dir, NekDouble angle, NekDouble tol)
Get the orientation of face1.
Definition TriGeom.cpp:207
int v_AllLeftCheck(const Array< OneD, const NekDouble > &gloCoord) override
Definition TriGeom.cpp:107
std::array< SegGeom *, kNedges > m_edges
Definition TriGeom.h:120
PointGeom * v_GetVertex(const int i) const final
Returns vertex i of this object.
Definition TriGeom.h:104
NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord) override
Given local collapsed coordinate Lcoord, return the value of physical coordinate in direction i.
Definition TriGeom.cpp:193
Geometry1D * v_GetEdge(const int i) const final
Returns edge i of this object.
Definition TriGeom.h:109
void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
Definition TriGeom.cpp:617
int v_GetNumEdges() const final
Get the number of edges of this object.
Definition TriGeom.h:99
int v_GetNumVerts() const final
Get the number of vertices of this object.
Definition TriGeom.h:94
GeomFactorsUniquePtr v_GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt) override
Used by Expansion to generate associated GeomFactors.
Definition TriGeom.cpp:388
GeomType v_CalcGeomType() override
Definition TriGeom.cpp:316
static const int kNverts
Definition TriGeom.h:58
std::array< StdRegions::Orientation, kNedges > m_eorient
Definition TriGeom.h:121
std::vector< PointsKey > PointsKeyVector
Definition Points.h:313
unique_ptr_objpool< GeomFactors > GeomFactorsUniquePtr
Definition Geometry.h:62
std::map< int, CurveUniquePtr > CurveMap
Definition Geometry.h:71
GeomType
Indicates the type of element geometry.