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 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: 3D geometry information.
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SPATIALDOMAINS_GEOMETRY3D_H
37 #define NEKTAR_SPATIALDOMAINS_GEOMETRY3D_H
38 
40 #include <StdRegions/StdExpansion3D.h> // for StdExpansion3DSharedPtr, etc
41 
45 
46 namespace Nektar
47 {
48  namespace SpatialDomains
49  {
50  class Geometry2D;
51  class Geometry3D;
52  class CompToElmt;
53  typedef boost::shared_ptr<Geometry3D> Geometry3DSharedPtr;
54  typedef boost::shared_ptr<Geometry2D> Geometry2DSharedPtr;
55  typedef std::vector<Geometry3DSharedPtr> Geometry3DVector;
56  typedef std::vector<Geometry2DSharedPtr> Geometry2DVector;
58 
59  class PointGeom;
60  typedef boost::shared_ptr<PointGeom> PointGeomSharedPtr;
61  typedef std::vector<PointGeomSharedPtr> PointGeomVector;
62 
63  class SegGeom;
64  typedef boost::shared_ptr<SegGeom> SegGeomSharedPtr;
65  typedef std::vector<SegGeomSharedPtr> SegGeomVector;
66 
67 
68 
69  /// 3D geometry information
70  class Geometry3D : public Geometry
71  {
72  public:
74  SPATIAL_DOMAINS_EXPORT Geometry3D(const int coordim);
76 
77  //---------------------------------------
78  // Helper functions
79  //---------------------------------------
80  SPATIAL_DOMAINS_EXPORT int GetEid(int i) const;
82  GetEdge(int i) const;
83  SPATIAL_DOMAINS_EXPORT Geometry2DSharedPtr
84  GetFace(int i);
86  GetDir(const int faceidx, const int facedir) const;
87 
88  protected:
89  PointGeomVector m_verts;
90  SegGeomVector m_edges;
91  Geometry2DVector m_faces;
92  std::vector<StdRegions::Orientation> m_eorient;
93  std::vector<StdRegions::Orientation> m_forient;
94  std::list<CompToElmt> m_elmtmap;
95  bool m_owndata;
96  int m_eid;
97  bool m_ownverts;
98 
99  //---------------------------------------
100  // 3D Geometry Methods
101  //---------------------------------------
102 
104  const Array<OneD, const NekDouble> &coords,
105  const Array<OneD, const NekDouble> &ptsx,
106  const Array<OneD, const NekDouble> &ptsy,
107  const Array<OneD, const NekDouble> &ptsz,
108  Array<OneD, NekDouble> &Lcoords,
109  NekDouble &resid);
110 
111  virtual void v_FillGeom();
112  virtual NekDouble v_GetCoord(const int i,
113  const Array<OneD, const NekDouble> &Lcoord);
114  virtual void v_GenGeomFactors();
115 
116  //---------------------------------------
117  // Helper functions
118  //---------------------------------------
119  virtual int v_GetShapeDim() const;
120  virtual int v_GetVid(int i) const;
121  virtual PointGeomSharedPtr v_GetVertex(int i) const;
122  virtual const SegGeomSharedPtr v_GetEdge(int i) const;
123  virtual StdRegions::Orientation v_GetEorient(const int i) const;
124  virtual int v_GetEid(int i) const;
125  virtual const Geometry2DSharedPtr v_GetFace(int i) const;
126  virtual StdRegions::Orientation v_GetForient(const int i) const;
127  virtual int v_GetFid(int i) const;
128  virtual int v_GetEid() const;
129  virtual int v_WhichEdge(SegGeomSharedPtr edge);
130  virtual int v_WhichFace(Geometry2DSharedPtr face);
131  virtual const LibUtilities::BasisSharedPtr
132  v_GetBasis(const int i);
133  virtual int v_GetDir(const int faceidx,
134  const int facedir) const = 0;
135 
136  //---------------------------------------
137  // Element connection functions
138  //---------------------------------------
139  virtual void v_AddElmtConnected(int gvo_id, int locid);
140  virtual bool v_IsElmtConnected (int gvo_id, int locid) const;
141  virtual int v_NumElmtConnected() const;
142  virtual void v_SetOwnData();
143  };
144 
145  }; //end of namespace
146 }; //end of namespace
147 
148 #endif //NEKTAR_SPATIALDOMAINS_GEOMETRY3D_H
std::vector< StdRegions::Orientation > m_eorient
Definition: Geometry3D.h:92
Base class for shape geometry information.
Definition: Geometry.h:76
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry3D.h:61
int GetDir(const int faceidx, const int facedir) const
Returns the element coordinate direction corresponding to a given face coordinate direction...
Definition: Geometry3D.cpp:88
virtual PointGeomSharedPtr v_GetVertex(int i) const
Return vertex i in this element.
Definition: Geometry3D.cpp:362
std::list< CompToElmt > m_elmtmap
Definition: Geometry3D.h:94
virtual int v_GetShapeDim() const
Return the dimension of this element.
Definition: Geometry3D.cpp:343
Structure holding graphvertexobject id and local element facet id.
int GetEid(int i) const
Return the ID of edge i in this element.
Definition: Geometry3D.cpp:71
Geometry2DSharedPtr GetFace(int i)
Return face i in this element.
Definition: Geometry3D.cpp:79
std::vector< Geometry3DSharedPtr >::iterator Geometry3DVectorIter
Definition: Geometry3D.h:57
std::vector< Geometry3DSharedPtr > Geometry3DVector
Definition: Geometry3D.h:55
std::vector< SegGeomSharedPtr > SegGeomVector
Definition: Geometry3D.h:65
std::vector< StdRegions::Orientation > m_forient
Definition: Geometry3D.h:93
virtual int v_WhichEdge(SegGeomSharedPtr edge)
Return the local ID of a given edge.
Definition: Geometry3D.cpp:455
virtual int v_GetFid(int i) const
Return the ID of face i in this element.
Definition: Geometry3D.cpp:424
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:96
virtual int v_WhichFace(Geometry2DSharedPtr face)
Return the local ID of a given face.
Definition: Geometry3D.cpp:480
virtual void v_AddElmtConnected(int gvo_id, int locid)
Definition: Geometry3D.cpp:499
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:60
virtual bool v_IsElmtConnected(int gvo_id, int locid) const
Definition: Geometry3D.cpp:510
virtual int v_GetDir(const int faceidx, const int facedir) const =0
double NekDouble
virtual int v_GetVid(int i) const
Return the vertex ID of vertex i.
Definition: Geometry3D.cpp:351
virtual StdRegions::Orientation v_GetEorient(const int i) const
Return the orientation of edge i in this element.
Definition: Geometry3D.cpp:381
virtual const LibUtilities::BasisSharedPtr v_GetBasis(const int i)
Return the j-th basis of the i-th co-ordinate dimension.
Definition: Geometry3D.cpp:443
virtual int v_GetEid() const
Return the ID of this element.
Definition: Geometry3D.cpp:435
virtual void v_FillGeom()
Put all quadrature information into face/edge structure and backward transform.
Definition: Geometry3D.cpp:244
boost::shared_ptr< Geometry2D > Geometry2DSharedPtr
Definition: Geometry2D.h:59
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
const Geometry1DSharedPtr GetEdge(int i) const
virtual StdRegions::Orientation v_GetForient(const int i) const
Return the orientation of face i in this element.
Definition: Geometry3D.cpp:413
3D geometry information
Definition: Geometry3D.h:70
virtual const Geometry2DSharedPtr v_GetFace(int i) const
Return face i in this element.
Definition: Geometry3D.cpp:404
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
Definition: Geometry1D.h:48
std::vector< Geometry2DSharedPtr > Geometry2DVector
Definition: Geometry2D.h:61
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:323
virtual const SegGeomSharedPtr v_GetEdge(int i) const
Return edge i of this element.
Definition: Geometry3D.cpp:370
boost::shared_ptr< Basis > BasisSharedPtr
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
#define SPATIAL_DOMAINS_EXPORT
virtual int v_NumElmtConnected() const
Definition: Geometry3D.cpp:505
boost::shared_ptr< Geometry3D > Geometry3DSharedPtr
Definition: Geometry3D.h:52