Nektar++
HexGeom.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: HexGeom.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: Hexahedral geometry information.
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_SPATIALDOMAINS_HEXGEOM_H
36 #define NEKTAR_SPATIALDOMAINS_HEXGEOM_H
37 
40 
41 namespace Nektar
42 {
43 namespace SpatialDomains
44 {
45 
46 class QuadGeom;
47 typedef std::shared_ptr<QuadGeom> QuadGeomSharedPtr;
48 
49 class HexGeom : public Geometry3D
50 {
51 public:
53  SPATIAL_DOMAINS_EXPORT HexGeom(int id, const QuadGeomSharedPtr faces[]);
55 
56  SPATIAL_DOMAINS_EXPORT static const int kNverts = 8;
57  SPATIAL_DOMAINS_EXPORT static const int kNedges = 12;
58  SPATIAL_DOMAINS_EXPORT static const int kNqfaces = 6;
59  SPATIAL_DOMAINS_EXPORT static const int kNtfaces = 0;
60  SPATIAL_DOMAINS_EXPORT static const int kNfaces = kNqfaces + kNtfaces;
61  SPATIAL_DOMAINS_EXPORT static const std::string XMLElementType;
62 
63 protected:
64  virtual void v_GenGeomFactors();
66  Array<OneD, NekDouble> &Lcoords);
67  virtual bool v_ContainsPoint(const Array<OneD, const NekDouble> &gloCoord,
68  Array<OneD, NekDouble> &locCoord,
69  NekDouble tol,
70  NekDouble &resid);
71  virtual int v_GetVertexEdgeMap(const int i, const int j) const;
72  virtual int v_GetVertexFaceMap(const int i, const int j) const;
73  virtual int v_GetEdgeFaceMap(const int i, const int j) const;
74  virtual int v_GetDir(const int faceidx, const int facedir) const;
75  virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces);
76  virtual void v_Setup();
77 
78 private:
79  void SetUpLocalEdges();
80  void SetUpLocalVertices();
81  void SetUpEdgeOrientation();
82  void SetUpFaceOrientation();
83  void SetUpXmap();
84 
85  static const unsigned int VertexEdgeConnectivity[8][3];
86  static const unsigned int VertexFaceConnectivity[8][3];
87  static const unsigned int EdgeFaceConnectivity[12][2];
88 };
89 
90 typedef std::shared_ptr<HexGeom> HexGeomSharedPtr;
91 typedef std::map<int, HexGeomSharedPtr> HexGeomMap;
92 }
93 }
94 
95 #endif
static const std::string XMLElementType
Definition: HexGeom.h:61
static const unsigned int VertexEdgeConnectivity[8][3]
Definition: HexGeom.h:85
void SetUpXmap()
Set up the m_xmap object by determining the order of each direction from derived faces.
Definition: HexGeom.cpp:853
virtual void v_GenGeomFactors()
Definition: HexGeom.cpp:87
std::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:62
static const int kNtfaces
Definition: HexGeom.h:59
static const int kNverts
Definition: HexGeom.h:56
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: HexGeom.h:46
virtual int v_GetEdgeFaceMap(const int i, const int j) const
Returns the standard element edge IDs that are connected to a given face.
Definition: HexGeom.cpp:297
static const int kNfaces
Definition: HexGeom.h:60
virtual NekDouble v_GetLocCoords(const Array< OneD, const NekDouble > &coords, Array< OneD, NekDouble > &Lcoords)
Determine the local collapsed coordinates that correspond to a given Cartesian coordinate for this ge...
Definition: HexGeom.cpp:152
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
Definition: HexGeom.cpp:254
virtual void v_Reset(CurveMap &curvedEdges, CurveMap &curvedFaces)
Reset this geometry object: unset the current state, zero Geometry::m_coeffs and remove allocated Geo...
Definition: HexGeom.cpp:822
virtual int v_GetVertexFaceMap(const int i, const int j) const
Returns the standard element face IDs that are connected to a given vertex.
Definition: HexGeom.cpp:292
double NekDouble
3D geometry information
Definition: Geometry3D.h:67
static const unsigned int EdgeFaceConnectivity[12][2]
Definition: HexGeom.h:87
std::shared_ptr< HexGeom > HexGeomSharedPtr
Definition: HexGeom.h:90
static const unsigned int VertexFaceConnectivity[8][3]
Definition: HexGeom.h:86
static const int kNqfaces
Definition: HexGeom.h:58
virtual int v_GetDir(const int faceidx, const int facedir) const
Definition: HexGeom.cpp:302
static const int kNedges
Definition: HexGeom.h:57
std::map< int, HexGeomSharedPtr > HexGeomMap
Definition: HexGeom.h:91
virtual int v_GetVertexEdgeMap(const int i, const int j) const
Returns the standard element edge IDs that are connected to a given vertex.
Definition: HexGeom.cpp:287
#define SPATIAL_DOMAINS_EXPORT