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 
45 namespace Nektar
46 {
47 
48 namespace SpatialDomains
49 {
50 
51 class Geometry2D;
52 class Geometry3D;
53 typedef std::shared_ptr<Geometry3D> Geometry3DSharedPtr;
54 typedef std::shared_ptr<Geometry2D> Geometry2DSharedPtr;
55 typedef std::vector<Geometry3DSharedPtr> Geometry3DVector;
56 typedef std::vector<Geometry2DSharedPtr> Geometry2DVector;
57 
58 class PointGeom;
59 typedef std::shared_ptr<PointGeom> PointGeomSharedPtr;
60 typedef std::vector<PointGeomSharedPtr> PointGeomVector;
61 
62 class SegGeom;
63 typedef std::shared_ptr<SegGeom> SegGeomSharedPtr;
64 typedef std::vector<SegGeomSharedPtr> SegGeomVector;
65 
66 /// 3D geometry information
67 class Geometry3D : public Geometry
68 {
69 public:
71  SPATIAL_DOMAINS_EXPORT Geometry3D(const int coordim);
73 
74  //---------------------------------------
75  // Helper functions
76  //---------------------------------------
77  SPATIAL_DOMAINS_EXPORT int GetDir(const int faceidx,
78  const int facedir) const;
79 
80  SPATIAL_DOMAINS_EXPORT static const int kDim = 3;
81 
82 protected:
83  PointGeomVector m_verts;
84  SegGeomVector m_edges;
85  Geometry2DVector m_faces;
86  std::vector<StdRegions::Orientation> m_eorient;
87  std::vector<StdRegions::Orientation> m_forient;
88  int m_eid;
89  bool m_ownverts;
90 
91  //---------------------------------------
92  // 3D Geometry Methods
93  //---------------------------------------
94 
96  const Array<OneD, const NekDouble> &ptsx,
97  const Array<OneD, const NekDouble> &ptsy,
98  const Array<OneD, const NekDouble> &ptsz,
99  Array<OneD, NekDouble> &Lcoords,
100  NekDouble &resid);
101 
102  virtual void v_FillGeom();
103  virtual NekDouble v_GetCoord(const int i,
104  const Array<OneD, const NekDouble> &Lcoord);
105 
106  //---------------------------------------
107  // Helper functions
108  //---------------------------------------
109  virtual int v_GetShapeDim() const;
110  virtual int v_GetNumVerts() const;
111  virtual int v_GetNumEdges() const;
112  virtual int v_GetNumFaces() const;
113  virtual PointGeomSharedPtr v_GetVertex(int i) const;
114  virtual Geometry1DSharedPtr v_GetEdge(int i) const;
115  virtual Geometry2DSharedPtr v_GetFace(int i) const;
116  virtual StdRegions::Orientation v_GetEorient(const int i) const;
117  virtual StdRegions::Orientation v_GetForient(const int i) const;
118  virtual int v_GetDir(const int faceidx, const int facedir) const = 0;
119 };
120 
121 } // end of namespace
122 } // end of namespace
123 
124 #endif // NEKTAR_SPATIALDOMAINS_GEOMETRY3D_H
int GetDir(const int faceidx, const int facedir) const
Returns the element coordinate direction corresponding to a given face coordinate direction...
Definition: Geometry3D.cpp:73
virtual StdRegions::Orientation v_GetEorient(const int i) const
Returns the orientation of edge i with respect to the ordering of edges in the standard element...
Definition: Geometry3D.cpp:348
std::vector< StdRegions::Orientation > m_eorient
Definition: Geometry3D.h:86
std::shared_ptr< Geometry3D > Geometry3DSharedPtr
Definition: Geometry3D.h:52
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry.h:65
Base class for shape geometry information.
Definition: Geometry.h:83
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry2D.h:64
virtual PointGeomSharedPtr v_GetVertex(int i) const
Definition: Geometry3D.cpp:329
virtual StdRegions::Orientation v_GetForient(const int i) const
Returns the orientation of face i with respect to the ordering of faces in the standard element...
Definition: Geometry3D.cpp:356
std::vector< Geometry3DSharedPtr > Geometry3DVector
Definition: Geometry3D.h:55
std::vector< SegGeomSharedPtr > SegGeomVector
Definition: Geometry2D.h:65
std::vector< StdRegions::Orientation > m_forient
Definition: Geometry3D.h:87
virtual int v_GetNumEdges() const
Get the number of edges of this object.
Definition: Geometry3D.cpp:319
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 &resid)
Definition: Geometry3D.cpp:81
virtual Geometry1DSharedPtr v_GetEdge(int i) const
Returns edge i of this object.
Definition: Geometry3D.cpp:334
virtual int v_GetDir(const int faceidx, const int facedir) const =0
double NekDouble
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
virtual int v_GetNumVerts() const
Get the number of vertices of this object.
Definition: Geometry3D.cpp:314
virtual Geometry2DSharedPtr v_GetFace(int i) const
Returns face i of this object.
Definition: Geometry3D.cpp:342
virtual void v_FillGeom()
Put all quadrature information into face/edge structure and backward transform.
Definition: Geometry3D.cpp:235
3D geometry information
Definition: Geometry3D.h:67
virtual int v_GetNumFaces() const
Get the number of faces of this object.
Definition: Geometry3D.cpp:324
std::vector< Geometry2DSharedPtr > Geometry2DVector
Definition: Geometry2D.h:63
virtual NekDouble v_GetCoord(const int i, const Array< OneD, const NekDouble > &Lcoord)
Given local collapsed coordinate Lcoord return the value of physical coordinate in direction i...
Definition: Geometry3D.cpp:294
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry.h:63
virtual int v_GetShapeDim() const
Get the object&#39;s shape dimension.
Definition: Geometry3D.cpp:309
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62
#define SPATIAL_DOMAINS_EXPORT