Nektar++
Geometry3D.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: Geometry3D.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: 3D geometry information.
32//
33////////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SPATIALDOMAINS_GEOMETRY3D_H
36#define NEKTAR_SPATIALDOMAINS_GEOMETRY3D_H
37
40
44
46{
47
48class Geometry2D;
49class Geometry3D;
50typedef std::shared_ptr<Geometry3D> Geometry3DSharedPtr;
51typedef std::shared_ptr<Geometry2D> Geometry2DSharedPtr;
52typedef std::vector<Geometry3DSharedPtr> Geometry3DVector;
53typedef std::vector<Geometry2DSharedPtr> Geometry2DVector;
54
55class PointGeom;
56typedef std::shared_ptr<PointGeom> PointGeomSharedPtr;
57typedef std::vector<PointGeomSharedPtr> PointGeomVector;
58
59class SegGeom;
60typedef std::shared_ptr<SegGeom> SegGeomSharedPtr;
61typedef std::vector<SegGeomSharedPtr> SegGeomVector;
62
63/// 3D geometry information
64class Geometry3D : public Geometry
65{
66public:
68 SPATIAL_DOMAINS_EXPORT Geometry3D(const int coordim);
70
71 //---------------------------------------
72 // Helper functions
73 //---------------------------------------
74 SPATIAL_DOMAINS_EXPORT static const int kDim = 3;
75
76protected:
80 std::vector<StdRegions::Orientation> m_eorient;
81 std::vector<StdRegions::Orientation> m_forient;
82 int m_eid;
84
85 //---------------------------------------
86 // 3D Geometry Methods
87 //---------------------------------------
88
91 Array<OneD, NekDouble> &Lcoords) override;
92
98 NekDouble &dist);
100 Array<OneD, NekDouble> &Lcoords);
101
102 void v_FillGeom() override;
103 NekDouble v_GetCoord(const int i,
104 const Array<OneD, const NekDouble> &Lcoord) override;
105 void v_CalculateInverseIsoParam() override;
106 int v_AllLeftCheck(const Array<OneD, const NekDouble> &gloCoord) override;
107
108 //---------------------------------------
109 // Helper functions
110 //---------------------------------------
111 int v_GetShapeDim() const override;
112 int v_GetNumVerts() const override;
113 int v_GetNumEdges() const override;
114 int v_GetNumFaces() const override;
115 PointGeomSharedPtr v_GetVertex(int i) const override;
116 Geometry1DSharedPtr v_GetEdge(int i) const override;
117 Geometry2DSharedPtr v_GetFace(int i) const override;
118 StdRegions::Orientation v_GetEorient(const int i) const override;
119 StdRegions::Orientation v_GetForient(const int i) const override;
120};
121
122} // namespace Nektar::SpatialDomains
123
124#endif // NEKTAR_SPATIALDOMAINS_GEOMETRY3D_H
#define SPATIAL_DOMAINS_EXPORT
3D geometry information
Definition: Geometry3D.h:65
Geometry2DSharedPtr v_GetFace(int i) const override
Returns face i of this object.
Definition: Geometry3D.cpp:548
int v_GetNumFaces() const override
Get the number of faces of this object.
Definition: Geometry3D.cpp:530
NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords) override
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this ge...
Definition: Geometry3D.cpp:369
int v_AllLeftCheck(const Array< OneD, const NekDouble > &gloCoord) override
Definition: Geometry3D.cpp:189
int v_GetNumEdges() const override
Get the number of edges of this object.
Definition: Geometry3D.cpp:525
std::vector< StdRegions::Orientation > m_forient
Definition: Geometry3D.h:81
void v_CalculateInverseIsoParam() override
Definition: Geometry3D.cpp:570
void v_FillGeom() override
Put all quadrature information into face/edge structure and backward transform.
Definition: Geometry3D.cpp:447
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: Geometry3D.cpp:500
PointGeomSharedPtr v_GetVertex(int i) const override
Definition: Geometry3D.cpp:535
void NewtonIterationForLocCoord(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, const Array< OneD, const NekDouble > &ptsz, Array< OneD, NekDouble > &Lcoords, NekDouble &dist)
Definition: Geometry3D.cpp:196
Geometry1DSharedPtr v_GetEdge(int i) const override
Returns edge i of this object.
Definition: Geometry3D.cpp:540
StdRegions::Orientation v_GetForient(const int i) const override
Returns the orientation of face i with respect to the ordering of faces in the standard element.
Definition: Geometry3D.cpp:562
int v_GetShapeDim() const override
Get the object's shape dimension.
Definition: Geometry3D.cpp:515
StdRegions::Orientation v_GetEorient(const int i) const override
Returns the orientation of edge i with respect to the ordering of edges in the standard element.
Definition: Geometry3D.cpp:554
std::vector< StdRegions::Orientation > m_eorient
Definition: Geometry3D.h:80
int v_GetNumVerts() const override
Get the number of vertices of this object.
Definition: Geometry3D.cpp:520
Base class for shape geometry information.
Definition: Geometry.h:79
std::vector< Geometry3DSharedPtr > Geometry3DVector
Definition: Geometry3D.h:52
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry2D.h:61
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:59
std::vector< Geometry2DSharedPtr > Geometry2DVector
Definition: Geometry2D.h:60
std::vector< SegGeomSharedPtr > SegGeomVector
Definition: Geometry2D.h:62
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:57
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:62
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:61
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
Definition: Geometry3D.h:50
double NekDouble