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
44{
45
46class PointGeom;
47class SegGeom;
48
49// shorthand for boost pointer
50typedef std::shared_ptr<PointGeom> PointGeomSharedPtr;
51typedef std::map<int, PointGeomSharedPtr> PointGeomMap;
52
53class PointGeom : public Geometry0D,
54 public NekPoint<NekDouble>,
55 public std::enable_shared_from_this<PointGeom>
56{
57public:
59 SPATIAL_DOMAINS_EXPORT PointGeom(const int coordim, const int vid,
62
64
66 {
67 return m_globalID;
68 }
69
71 NekDouble &z);
74 NekDouble z);
75
79 SPATIAL_DOMAINS_EXPORT void Rotate(PointGeom &a, int dir, NekDouble angle);
82
84 const PointGeom &y);
86 const PointGeom *y);
88 const PointGeom &y);
90 const PointGeom &y);
92 const PointGeom *y);
94 const PointGeom &y);
95
96protected:
97 void v_GenGeomFactors() override;
98 PointGeomSharedPtr v_GetVertex(int i) const override;
99};
100
101} // namespace Nektar::SpatialDomains
102
103#endif // NEKTAR_SPATIALDOMAINS_POINTGEOM_H
#define SPATIAL_DOMAINS_EXPORT
boost::call_traits< DataType >::const_reference x() const
Definition: NekPoint.hpp:160
boost::call_traits< DataType >::const_reference a() const
Definition: NekPoint.hpp:178
boost::call_traits< DataType >::const_reference z() const
Definition: NekPoint.hpp:172
boost::call_traits< DataType >::const_reference b() const
Definition: NekPoint.hpp:184
boost::call_traits< DataType >::const_reference y() const
Definition: NekPoint.hpp:166
1D geometry information
Definition: Geometry0D.h:52
void Sub(PointGeom &a, PointGeom &b)
Definition: PointGeom.cpp:122
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition: PointGeom.cpp:73
void Mult(PointGeom &a, PointGeom &b)
_this = a x b
Definition: PointGeom.cpp:131
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:192
void Rotate(PointGeom &a, int dir, NekDouble angle)
_this = rotation of a by angle 'angle' around axis dir
Definition: PointGeom.cpp:140
NekDouble dot(PointGeom &a)
retun the dot product between this and input a
Definition: PointGeom.cpp:185
void Add(PointGeom &a, PointGeom &b)
Definition: PointGeom.cpp:113
friend bool operator!=(const PointGeom &x, const PointGeom &y)
Definition: PointGeom.cpp:207
PointGeomSharedPtr v_GetVertex(int i) const override
Definition: PointGeom.cpp:222
void UpdatePosition(NekDouble x, NekDouble y, NekDouble z)
Definition: PointGeom.cpp:105
NekDouble dist(PointGeom &a)
return distance between this and input a
Definition: PointGeom.cpp:178
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:57
std::map< int, PointGeomSharedPtr > PointGeomMap
Definition: PointGeom.h:51
double NekDouble