Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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;
84  GetFace(int i);
86  GetFaceOrient(const int i) const;
88  GetDir(const int faceidx, const int facedir) const;
89 
90  protected:
94  std::vector<StdRegions::Orientation> m_eorient;
95  std::vector<StdRegions::Orientation> m_forient;
96  std::list<CompToElmt> m_elmtmap;
97  bool m_owndata;
98  int m_eid;
99  bool m_ownverts;
100 
101  //---------------------------------------
102  // 3D Geometry Methods
103  //---------------------------------------
104 
106  const Array<OneD, const NekDouble> &coords,
107  const Array<OneD, const NekDouble> &ptsx,
108  const Array<OneD, const NekDouble> &ptsy,
109  const Array<OneD, const NekDouble> &ptsz,
110  Array<OneD, NekDouble> &Lcoords,
111  NekDouble &resid);
112 
113  virtual void v_FillGeom();
114  virtual NekDouble v_GetCoord(const int i,
115  const Array<OneD, const NekDouble> &Lcoord);
116  virtual void v_GenGeomFactors();
117 
118  //---------------------------------------
119  // Helper functions
120  //---------------------------------------
121  virtual int v_GetShapeDim() const;
122  virtual int v_GetVid(int i) const;
123  virtual PointGeomSharedPtr v_GetVertex(int i) const;
124  virtual const SegGeomSharedPtr v_GetEdge(int i) const;
125  virtual StdRegions::Orientation v_GetEorient(const int i) const;
126  virtual int v_GetEid(int i) const;
127  virtual const Geometry2DSharedPtr v_GetFace(int i) const;
128  virtual StdRegions::Orientation v_GetFaceOrient(const int i) const;
129  virtual int v_GetFid(int i) const;
130  virtual int v_GetEid() const;
131  virtual int v_WhichEdge(SegGeomSharedPtr edge);
132  virtual int v_WhichFace(Geometry2DSharedPtr face);
133  virtual const LibUtilities::BasisSharedPtr
134  v_GetBasis(const int i);
135  virtual int v_GetDir(const int faceidx,
136  const int facedir) const = 0;
137 
138  //---------------------------------------
139  // Element connection functions
140  //---------------------------------------
141  virtual void v_AddElmtConnected(int gvo_id, int locid);
142  virtual bool v_IsElmtConnected (int gvo_id, int locid) const;
143  virtual int v_NumElmtConnected() const;
144  virtual void v_SetOwnData();
145  };
146 
147  }; //end of namespace
148 }; //end of namespace
149 
150 #endif //NEKTAR_SPATIALDOMAINS_GEOMETRY3D_H