Nektar++
Loading...
Searching...
No Matches
QuadGeom.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: QuadGeom.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
36#ifndef NEKTAR_SPATIALDOMAINS_QUADGEOM_H
37#define NEKTAR_SPATIALDOMAINS_QUADGEOM_H
38
40
45
47{
48
49class QuadGeom;
50struct Curve;
51
52class QuadGeom : public Geometry2D
53{
54public:
55 SPATIAL_DOMAINS_EXPORT static const int kNedges = 4;
56 SPATIAL_DOMAINS_EXPORT static const int kNverts = 4;
58
62 std::array<SegGeom *, kNverts> edges,
63 Curve *curve = nullptr);
64 SPATIAL_DOMAINS_EXPORT ~QuadGeom() override = default;
65
66 /// Get the orientation of face1.
68 const QuadGeom &face1, const QuadGeom &face2, bool doRot = false,
69 int dir = 0, NekDouble angle = 0.0, NekDouble tol = 1e-8);
70
72 std::array<PointGeom *, 4> face1, std::array<PointGeom *, 4> face2,
73 bool doRot = false, int dir = 0, NekDouble angle = 0.0,
74 NekDouble tol = 1e-8);
75
76 SPATIAL_DOMAINS_EXPORT static const std::string XMLElementType;
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;
92
93 int v_AllLeftCheck(const Array<OneD, const NekDouble> &gloCoord) override;
94
95 inline int v_GetNumVerts() const final
96 {
97 return kNverts;
98 }
99
100 inline int v_GetNumEdges() const final
101 {
102 return kNedges;
103 }
104
105 inline PointGeom *v_GetVertex(const int i) const final
106 {
107 return m_verts[i];
108 }
109
110 inline Geometry1D *v_GetEdge(const int i) const final
111 {
112 return static_cast<Geometry1D *>(m_edges[i]);
113 }
114
115 inline StdRegions::Orientation v_GetEorient(const int i) const final
116 {
117 return m_eorient[i];
118 }
119
120 std::array<PointGeom *, kNverts> m_verts;
121 std::array<SegGeom *, kNedges> m_edges;
122 std::array<StdRegions::Orientation, kNedges> m_eorient;
123
124private:
125 void SetUpXmap();
126};
127
128} // namespace Nektar::SpatialDomains
129
130#endif // NEKTAR_SPATIALDOMAINS_QUADGEOM_H
#define SPATIAL_DOMAINS_EXPORT
1D geometry information
Definition Geometry1D.h:49
2D geometry information
Definition Geometry2D.h:50
std::array< PointGeom *, kNverts > m_verts
Definition QuadGeom.h:120
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 QuadGeom.cpp:610
static const std::string XMLElementType
Definition QuadGeom.h:76
static StdRegions::Orientation GetFaceOrientation(const QuadGeom &face1, const QuadGeom &face2, bool doRot=false, int dir=0, NekDouble angle=0.0, NekDouble tol=1e-8)
Get the orientation of face1.
Definition QuadGeom.cpp:228
std::array< StdRegions::Orientation, kNedges > m_eorient
Definition QuadGeom.h:122
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 QuadGeom.cpp:214
int v_GetNumVerts() const final
Get the number of vertices of this object.
Definition QuadGeom.h:95
GeomFactorsUniquePtr v_GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt) override
Used by Expansion to generate associated GeomFactors.
Definition QuadGeom.cpp:467
PointGeom * v_GetVertex(const int i) const final
Returns vertex i of this object.
Definition QuadGeom.h:105
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 QuadGeom.h:115
std::array< SegGeom *, kNedges > m_edges
Definition QuadGeom.h:121
Geometry1D * v_GetEdge(const int i) const final
Returns edge i of this object.
Definition QuadGeom.h:110
int v_GetNumEdges() const final
Get the number of edges of this object.
Definition QuadGeom.h:100
int v_GetDir(const int faceidx, const int facedir) const override
Returns the element coordinate direction corresponding to a given face coordinate direction.
Definition QuadGeom.cpp:605
QuadGeom(const int id, std::array< SegGeom *, kNverts > edges, Curve *curve=nullptr)
int v_AllLeftCheck(const Array< OneD, const NekDouble > &gloCoord) override
Definition QuadGeom.cpp:108
GeomType v_CalcGeomType() override
Definition QuadGeom.cpp:352
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.