Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QuadGeom.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: QuadGeom.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:
33 //
34 //
35 ////////////////////////////////////////////////////////////////////////////////
36 #ifndef NEKTAR_SPATIALDOMAINS_QUADGEOM_H
37 #define NEKTAR_SPATIALDOMAINS_QUADGEOM_H
38 
40 
44 #include <SpatialDomains/SegGeom.h> // for SegGeomSharedPtr, etc
45 
46 
47 namespace Nektar
48 {
49  namespace SpatialDomains
50  {
51  class QuadGeom;
52  struct Curve;
53  typedef boost::shared_ptr<Curve> CurveSharedPtr;
54  typedef boost::shared_ptr<QuadGeom> QuadGeomSharedPtr;
55  typedef std::vector< QuadGeomSharedPtr > QuadGeomVector;
57  typedef std::map<int, QuadGeomSharedPtr> QuadGeomMap;
59 
60  class QuadGeom: public Geometry2D
61  {
62  public:
64 
65  SPATIAL_DOMAINS_EXPORT QuadGeom(int id, const int coordim);
66 
68  const int id,
69  const PointGeomSharedPtr verts[],
70  const SegGeomSharedPtr edges[],
71  const StdRegions::Orientation eorient[]);
72 
74  const int id,
75  const SegGeomSharedPtr edges[],
76  const StdRegions::Orientation eorient[]);
77 
79  const int id,
80  const SegGeomSharedPtr edges[],
81  const StdRegions::Orientation eorient[],
82  const CurveSharedPtr &curve);
83 
84  SPATIAL_DOMAINS_EXPORT QuadGeom(const QuadGeom &in);
85 
87 
89  const int i,
90  const Array<OneD, const NekDouble> &Lcoord);
91 
92  /// Get the orientation of face1.
95  const QuadGeom &face1,
96  const QuadGeom &face2);
99  const PointGeomVector &face1,
100  const PointGeomVector &face2);
101 
102  SPATIAL_DOMAINS_EXPORT static const int kNverts = 4;
103  SPATIAL_DOMAINS_EXPORT static const int kNedges = 4;
104  SPATIAL_DOMAINS_EXPORT static const std::string XMLElementType;
105 
106  protected:
110  int m_fid;
112  std::list<CompToElmt> m_elmtMap;
113 
115  int gvo_id,
116  int locid);
117 
118  SPATIAL_DOMAINS_EXPORT virtual int v_NumElmtConnected() const;
119 
121  int gvo_id,
122  int locid) const;
123 
124  SPATIAL_DOMAINS_EXPORT virtual int v_GetFid() const;
125 
126  SPATIAL_DOMAINS_EXPORT virtual int v_GetCoordim() const;
127 
129  v_GetBasis(const int i);
130 
132  v_GetEdgeBasis(const int i);
133 
135  const int i,
136  const Array<OneD,const NekDouble> &Lcoord);
137 
139 
140  SPATIAL_DOMAINS_EXPORT virtual void v_SetOwnData();
141 
142  /// Put all quadrature information into edge structure
143  SPATIAL_DOMAINS_EXPORT virtual void v_FillGeom();
144 
146  const Array<OneD,const NekDouble> &coords,
147  Array<OneD,NekDouble> &Lcoords);
148 
149  SPATIAL_DOMAINS_EXPORT virtual int v_GetEid(int i) const;
150 
151  SPATIAL_DOMAINS_EXPORT virtual int v_GetVid(int i) const;
152 
154  v_GetVertex(int i) const;
155 
157  v_GetEdge(int i) const;
158 
160  v_GetEorient(const int i) const;
161 
163  v_GetCartesianEorient(const int i) const;
164 
165  /// Return the edge number of the given edge
167  SegGeomSharedPtr edge);
168 
169  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumVerts() const;
170 
171  SPATIAL_DOMAINS_EXPORT virtual int v_GetNumEdges() const;
172 
174  const Array<OneD, const NekDouble> &gloCoord,
175  NekDouble tol = 0.0);
176 
178  const Array<OneD, const NekDouble> &gloCoord,
179  Array<OneD, NekDouble> &locCoord,
180  NekDouble tol);
181 
183  const Array<OneD, const NekDouble> &gloCoord,
184  Array<OneD, NekDouble> &locCoord,
185  NekDouble tol,
186  NekDouble &resid);
187  private:
188  /// Boolean indicating whether object owns the data
189  bool m_ownData;
190 
191  };
192 
193  }; //end of namespace
194 }; //end of namespace
195 
196 #endif //NEKTAR_SPATIALDOMAINS_QUADGEOM_H