Nektar++
Geometry2D.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: Geometry2D.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: 2D geometry information
32//
33//
34////////////////////////////////////////////////////////////////////////////////
35
36#ifndef NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H
37#define NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H
38
41
44
45namespace Nektar
46{
47
48namespace SpatialDomains
49{
50
51class Geometry0D;
52class Geometry1D;
53class Geometry2D;
54class PointGeom;
55class SegGeom;
56
57// shorthand for boost pointer
58typedef std::shared_ptr<PointGeom> PointGeomSharedPtr;
59typedef std::shared_ptr<Geometry0D> Geometry0DSharedPtr;
60typedef std::shared_ptr<Geometry1D> Geometry1DSharedPtr;
61typedef std::shared_ptr<Geometry2D> Geometry2DSharedPtr;
62typedef std::shared_ptr<SegGeom> SegGeomSharedPtr;
63typedef std::vector<Geometry2DSharedPtr> Geometry2DVector;
64typedef std::vector<PointGeomSharedPtr> PointGeomVector;
65typedef std::vector<SegGeomSharedPtr> SegGeomVector;
66
67/// 2D geometry information
68class Geometry2D : public Geometry
69{
70public:
72 SPATIAL_DOMAINS_EXPORT Geometry2D(const int coordim, CurveSharedPtr curve);
74
75 SPATIAL_DOMAINS_EXPORT static const int kDim = 2;
77 {
78 return m_curve;
79 }
80
81protected:
84 std::vector<StdRegions::Orientation> m_eorient;
88
90 const Array<OneD, const NekDouble> &coords,
91 Array<OneD, NekDouble> &Lcoords) override;
92
97 NekDouble &dist);
99 Array<OneD, NekDouble> &Lcoords);
100 virtual void v_CalculateInverseIsoParam() override;
101 virtual int v_AllLeftCheck(
102 const Array<OneD, const NekDouble> &gloCoord) override;
103
104 //---------------------------------------
105 // Helper functions
106 //---------------------------------------
107 virtual int v_GetShapeDim() const override;
108 virtual PointGeomSharedPtr v_GetVertex(int i) const override;
109 virtual Geometry1DSharedPtr v_GetEdge(int i) const override;
110 virtual int v_GetNumVerts() const override;
111 virtual int v_GetNumEdges() const override;
112 virtual StdRegions::Orientation v_GetEorient(const int i) const override;
114 Array<OneD, NekDouble> &xi) override;
115};
116
117} // namespace SpatialDomains
118} // namespace Nektar
119
120#endif // NEKTAR_SPATIALDOMAINS_GEOMETRY2D_H
#define SPATIAL_DOMAINS_EXPORT
2D geometry information
Definition: Geometry2D.h:69
virtual int v_GetShapeDim() const override
Get the object's shape dimension.
Definition: Geometry2D.cpp:394
void NewtonIterationForLocCoord(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &ptsx, const Array< OneD, const NekDouble > &ptsy, Array< OneD, NekDouble > &Lcoords, NekDouble &dist)
Definition: Geometry2D.cpp:185
Array< OneD, int > m_manifold
Definition: Geometry2D.h:86
Array< OneD, Array< OneD, NekDouble > > m_edgeNormal
Definition: Geometry2D.h:87
virtual PointGeomSharedPtr v_GetVertex(int i) const override
Definition: Geometry2D.cpp:376
virtual Geometry1DSharedPtr v_GetEdge(int i) const override
Returns edge i of this object.
Definition: Geometry2D.cpp:382
std::vector< StdRegions::Orientation > m_eorient
Definition: Geometry2D.h:84
virtual 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: Geometry2D.cpp:321
virtual int v_AllLeftCheck(const Array< OneD, const NekDouble > &gloCoord) override
Definition: Geometry2D.cpp:65
virtual void v_CalculateInverseIsoParam() override
Definition: Geometry2D.cpp:625
virtual 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: Geometry2D.cpp:388
virtual NekDouble v_FindDistance(const Array< OneD, const NekDouble > &xs, Array< OneD, NekDouble > &xi) override
Definition: Geometry2D.cpp:399
virtual int v_GetNumEdges() const override
Get the number of edges of this object.
Definition: Geometry2D.cpp:371
virtual int v_GetNumVerts() const override
Get the number of vertices of this object.
Definition: Geometry2D.cpp:366
Base class for shape geometry information.
Definition: Geometry.h:82
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry2D.h:64
std::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:60
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62
std::vector< Geometry2DSharedPtr > Geometry2DVector
Definition: Geometry2D.h:63
std::vector< SegGeomSharedPtr > SegGeomVector
Definition: Geometry2D.h:65
std::shared_ptr< Geometry0D > Geometry0DSharedPtr
Definition: Geometry0D.h:48
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:65
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:64
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble