Nektar++
Loading...
Searching...
No Matches
SegGeom.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: SegGeom.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: Segment geometry information
32//
33////////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SPATIALDOMAINS_SEGGEOM_H
36#define NEKTAR_SPATIALDOMAINS_SEGGEOM_H
37
45
47{
48
49class SegGeom;
50typedef unique_ptr_objpool<SegGeom> SegGeomUniquePtr;
51typedef unique_ptr_objpool<PointGeom> PointGeomUniquePtr;
53{
54public:
55 std::vector<PointGeomUniquePtr> m_pointVec;
56 std::vector<SegGeomUniquePtr> m_segVec;
57};
58
59class SegGeom : public Geometry1D
60{
61public:
62 SPATIAL_DOMAINS_EXPORT static const int kNverts = 2;
64
66 SPATIAL_DOMAINS_EXPORT SegGeom(int id, int coordim,
67 std::array<PointGeom *, kNverts> vertex,
68 Curve *curve = nullptr);
69
71
74
75 SPATIAL_DOMAINS_EXPORT ~SegGeom() override = default;
76
78 const SegGeom &edge1, const SegGeom &edge2);
79
81 {
82 return m_curve;
83 }
84 inline SPATIAL_DOMAINS_EXPORT void SetCurve(Curve *curvePtr)
85 {
86 m_curve = curvePtr;
87 }
88
89protected:
90 std::array<SpatialDomains::PointGeom *, kNverts> m_verts;
92
93 PointGeom *v_GetVertex(const int i) const override;
95 GeomType v_CalcGeomType() override;
97 LibUtilities::PointsKeyVector &keyTgt) override;
98 void v_FillGeom() override;
99 void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces) override;
100 void v_Setup() override;
101 NekDouble v_GetCoord(const int i,
102 const Array<OneD, const NekDouble> &Lcoord) override;
103 int v_GetNumVerts() const override;
105 Array<OneD, NekDouble> &xi) override;
106
107private:
108 /// Boolean indicating whether object owns the data
109 Curve *m_curve = nullptr;
110
111 void SetUpXmap();
112};
113
114} // namespace Nektar::SpatialDomains
115
116#endif // NEKTAR_SPATIALDOMAINS_SEGGEOM_H
#define SPATIAL_DOMAINS_EXPORT
std::vector< SegGeomUniquePtr > m_segVec
Definition SegGeom.h:56
std::vector< PointGeomUniquePtr > m_pointVec
Definition SegGeom.h:55
1D geometry information
Definition Geometry1D.h:49
GeomType v_CalcGeomType() override
Definition SegGeom.cpp:235
PointGeom * v_GetVertex(const int i) const override
Returns vertex i of this object.
Definition SegGeom.cpp:353
std::array< SpatialDomains::PointGeom *, kNverts > m_verts
Definition SegGeom.h:90
int v_GetNumVerts() const override
Get the number of vertices of this object.
Definition SegGeom.cpp:365
virtual LibUtilities::ShapeType v_GetShapeType() const
Definition SegGeom.cpp:177
static const int kNfacets
Definition SegGeom.h:63
StdRegions::Orientation m_porient[kNverts]
Definition SegGeom.h:91
void v_FillGeom() override
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition SegGeom.cpp:261
GeomFactorsUniquePtr v_GenGeomFactors(LibUtilities::PointsKeyVector &keyTgt) override
Used by Expansion to generate associated GeomFactors.
Definition SegGeom.cpp:253
Curve * m_curve
Boolean indicating whether object owns the data.
Definition SegGeom.h:109
static StdRegions::Orientation GetEdgeOrientation(const SegGeom &edge1, const SegGeom &edge2)
Get the orientation of edge1.
Definition SegGeom.cpp:211
NekDouble v_FindDistance(const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi) override
Definition SegGeom.cpp:370
static const int kNverts
Definition SegGeom.h:62
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 SegGeom.cpp:182
SegGeomUniquePtr GenerateOneSpaceDimGeom(EntityHolder1D &holder)
Generate a one dimensional space segment geometry where the vert[0] has the same x value and vert[1] ...
Definition SegGeom.cpp:122
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 SegGeom.cpp:329
void SetCurve(Curve *curvePtr)
Definition SegGeom.h:84
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.
unique_ptr_objpool< SegGeom > SegGeomUniquePtr
Definition MeshGraph.h:102
unique_ptr_objpool< PointGeom > PointGeomUniquePtr
Definition MeshGraph.h:99