Nektar++
PointGeom.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: PointGeom.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: Point geometry information
32 //
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 #ifndef NEKTAR_SPATIALDOMAINS_POINTGEOM_H
36 #define NEKTAR_SPATIALDOMAINS_POINTGEOM_H
37 
41 #include <memory>
42 
43 namespace Nektar
44 {
45 
46 namespace SpatialDomains
47 {
48 
49 class PointGeom;
50 class SegGeom;
51 
52 // shorthand for boost pointer
53 typedef std::shared_ptr<PointGeom> PointGeomSharedPtr;
54 typedef std::map<int, PointGeomSharedPtr> PointGeomMap;
55 
56 class PointGeom : public Geometry0D,
57  public NekPoint<NekDouble>,
58  public std::enable_shared_from_this<PointGeom>
59 {
60 public:
62  SPATIAL_DOMAINS_EXPORT PointGeom(const int coordim, const int vid,
65 
67 
69  {
70  return m_globalID;
71  }
72 
74  NekDouble &z);
77  NekDouble z);
78 
82  SPATIAL_DOMAINS_EXPORT void Rotate(PointGeom &a, int dir, NekDouble angle);
85 
86  SPATIAL_DOMAINS_EXPORT friend bool operator==(const PointGeom &x,
87  const PointGeom &y);
88  SPATIAL_DOMAINS_EXPORT friend bool operator==(const PointGeom &x,
89  const PointGeom *y);
90  SPATIAL_DOMAINS_EXPORT friend bool operator==(const PointGeom *x,
91  const PointGeom &y);
92  SPATIAL_DOMAINS_EXPORT friend bool operator!=(const PointGeom &x,
93  const PointGeom &y);
94  SPATIAL_DOMAINS_EXPORT friend bool operator!=(const PointGeom &x,
95  const PointGeom *y);
96  SPATIAL_DOMAINS_EXPORT friend bool operator!=(const PointGeom *x,
97  const PointGeom &y);
98 
99 protected:
100  virtual void v_GenGeomFactors() override;
101  virtual PointGeomSharedPtr v_GetVertex(int i) const override;
102 };
103 
104 } // namespace SpatialDomains
105 } // namespace Nektar
106 
107 #endif // NEKTAR_SPATIALDOMAINS_POINTGEOM_H
#define SPATIAL_DOMAINS_EXPORT
boost::call_traits< DataType >::const_reference z() const
Definition: NekPoint.hpp:172
boost::call_traits< DataType >::const_reference a() const
Definition: NekPoint.hpp:178
boost::call_traits< DataType >::const_reference b() const
Definition: NekPoint.hpp:184
boost::call_traits< DataType >::const_reference x() const
Definition: NekPoint.hpp:160
boost::call_traits< DataType >::const_reference y() const
Definition: NekPoint.hpp:166
1D geometry information
Definition: Geometry0D.h:54
void Sub(PointGeom &a, PointGeom &b)
Definition: PointGeom.cpp:124
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition: PointGeom.cpp:75
void Mult(PointGeom &a, PointGeom &b)
_this = a x b
Definition: PointGeom.cpp:133
friend bool operator==(const PointGeom &x, const PointGeom &y)
Determine equivalence by the ids. No matter what the position, if the ids are the same,...
Definition: PointGeom.cpp:194
void Rotate(PointGeom &a, int dir, NekDouble angle)
_this = rotation of a by angle 'angle' around axis dir
Definition: PointGeom.cpp:142
NekDouble dot(PointGeom &a)
retun the dot product between this and input a
Definition: PointGeom.cpp:187
void Add(PointGeom &a, PointGeom &b)
Definition: PointGeom.cpp:115
friend bool operator!=(const PointGeom &x, const PointGeom &y)
Definition: PointGeom.cpp:209
virtual void v_GenGeomFactors() override
Definition: PointGeom.cpp:232
virtual PointGeomSharedPtr v_GetVertex(int i) const override
Definition: PointGeom.cpp:224
void UpdatePosition(NekDouble x, NekDouble y, NekDouble z)
Definition: PointGeom.cpp:107
NekDouble dist(PointGeom &a)
return distance between this and input a
Definition: PointGeom.cpp:180
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
std::map< int, PointGeomSharedPtr > PointGeomMap
Definition: PointGeom.h:54
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble