Nektar++
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 // 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:
32 //
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 #ifndef NEKTAR_SPATIALDOMAINS_QUADGEOM_H
36 #define NEKTAR_SPATIALDOMAINS_QUADGEOM_H
37 
39 
43 #include <SpatialDomains/SegGeom.h>
44 
45 namespace Nektar
46 {
47 namespace SpatialDomains
48 {
49 
50 class QuadGeom;
51 struct Curve;
52 typedef std::shared_ptr<Curve> CurveSharedPtr;
53 typedef std::shared_ptr<QuadGeom> QuadGeomSharedPtr;
54 typedef std::map<int, QuadGeomSharedPtr> QuadGeomMap;
55 
56 class QuadGeom : public Geometry2D
57 {
58 public:
60  SPATIAL_DOMAINS_EXPORT QuadGeom(const QuadGeom &in);
62  const int id,
63  const SegGeomSharedPtr edges[],
64  const CurveSharedPtr curve = CurveSharedPtr());
66 
67  /// Get the orientation of face1.
69  const QuadGeom &face1, const QuadGeom &face2,
70  bool doRot = false, int dir = 0, NekDouble angle = 0.0,
71  NekDouble tol = 1e-8);
73  const PointGeomVector &face1, const PointGeomVector &face2,
74  bool doRot = false, int dir = 0, NekDouble angle = 0.0,
75  NekDouble tol = 1e-8);
76 
77  SPATIAL_DOMAINS_EXPORT static const int kNverts = 4;
78  SPATIAL_DOMAINS_EXPORT static const int kNedges = 4;
79  SPATIAL_DOMAINS_EXPORT static const std::string XMLElementType;
80 
81 protected:
83  const int i, const Array<OneD, const NekDouble> &Lcoord);
85  SPATIAL_DOMAINS_EXPORT virtual void v_FillGeom();
87  const Array<OneD, const NekDouble> &coords,
88  Array<OneD, NekDouble> &Lcoords);
90  const Array<OneD, const NekDouble> &gloCoord,
91  Array<OneD, NekDouble> &locCoord,
92  NekDouble tol,
93  NekDouble &resid);
94  SPATIAL_DOMAINS_EXPORT virtual void v_Reset(CurveMap &curvedEdges,
95  CurveMap &curvedFaces);
96  SPATIAL_DOMAINS_EXPORT virtual void v_Setup();
97 
98 private:
99  void SetUpXmap();
100 };
101 
102 }
103 }
104 
105 #endif // NEKTAR_SPATIALDOMAINS_QUADGEOM_H
static const int kNedges
Definition: QuadGeom.h:78
std::vector< PointGeomSharedPtr > PointGeomVector
Definition: Geometry2D.h:64
std::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:62
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
Definition: HexGeom.h:46
static const int kNverts
Definition: QuadGeom.h:77
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: QuadGeom.cpp:127
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: QuadGeom.cpp:511
double NekDouble
static StdRegions::Orientation GetFaceOrientation(const QuadGeom &face1, const QuadGeom &face2, bool doRot=false, int dir=0, NekDouble angle=0.0, NekDouble tol=1e-8)
Get the orientation of face1.
Definition: QuadGeom.cpp:138
std::map< int, QuadGeomSharedPtr > QuadGeomMap
Definition: QuadGeom.h:54
2D geometry information
Definition: Geometry2D.h:68
std::shared_ptr< Curve > CurveSharedPtr
Definition: Curve.hpp:61
virtual bool v_ContainsPoint(const Array< OneD, const NekDouble > &gloCoord, Array< OneD, NekDouble > &locCoord, NekDouble tol, NekDouble &resid)
Definition: QuadGeom.cpp:481
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: QuadGeom.cpp:418
std::shared_ptr< SegGeom > SegGeomSharedPtr
Definition: Geometry2D.h:62
#define SPATIAL_DOMAINS_EXPORT
static const std::string XMLElementType
Definition: QuadGeom.h:79