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  GetDir(const int faceidx, const int facedir) const;
87 
88  protected:
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