Advanced Multi-Physics (AMP)
On-Line Documentation
Geometry.h
Go to the documentation of this file.
1#ifndef included_AMP_Geometry
2#define included_AMP_Geometry
3
4#include "AMP/mesh/MeshID.h"
5#include "AMP/utils/Database.h"
6#include "AMP/utils/MeshPoint.h"
7
8#include <memory>
9#include <vector>
10
11
12namespace AMP::IO {
13class RestartManager;
14}
15
16
17namespace AMP::Geometry {
18
19
21
22
29{
30public:
32 virtual ~Geometry() = default;
33
35 virtual std::string getName() const = 0;
36
42 inline uint8_t getDim() const { return d_physicalDim; }
43
44
51
52
58 virtual bool isConvex() const = 0;
59
66 virtual Point nearest( const Point &pos ) const = 0;
67
78 virtual double distance( const Point &pos, const Point &dir ) const = 0;
79
87 virtual bool inside( const Point &pos ) const = 0;
88
94 virtual int NSurface() const = 0;
95
102 virtual int surface( const Point &x ) const = 0;
103
112 virtual Point surfaceNorm( const Point &x ) const = 0;
113
120 virtual Point centroid() const = 0;
121
127 virtual std::pair<Point, Point> box() const = 0;
128
134 virtual double volume() const = 0;
135
142 virtual void displace( const double *x ) = 0;
143
145 virtual std::unique_ptr<AMP::Geometry::Geometry> clone() const = 0;
146
148 virtual bool operator==( const Geometry &rhs ) const = 0;
149
151 inline bool operator!=( const Geometry &rhs ) const { return !operator==( rhs ); }
152
153
154public: // Write/read restart data
156 virtual uint64_t getID() const;
157
163 virtual void registerChildObjects( AMP::IO::RestartManager *manager ) const;
164
170 virtual void writeRestart( int64_t fid ) const;
171
172protected:
174 Geometry( int64_t fid );
175
176
177public:
184 static std::shared_ptr<AMP::Geometry::Geometry>
185 buildGeometry( std::shared_ptr<const AMP::Database> db );
186
187
188protected:
190 Geometry( int ndim ) : d_physicalDim( ndim ) {}
191
192 // Delete copy constructors
193 Geometry( Geometry && ) = delete;
194 Geometry( const Geometry & ) = default;
195 Geometry &operator=( Geometry && ) = delete;
196 Geometry &operator=( const Geometry & ) = delete;
197
198
199protected: // Internal data
200 const uint8_t d_physicalDim;
201};
202
203
204} // namespace AMP::Geometry
205
206#endif
A class used to abstract away geometry information from an application or mesh.
Definition Geometry.h:29
Geometry & operator=(Geometry &&)=delete
virtual void writeRestart(int64_t fid) const
Write restart data to file.
virtual int surface(const Point &x) const =0
Get the surface id.
virtual ~Geometry()=default
Destructor.
virtual bool operator==(const Geometry &rhs) const =0
Check if two geometries are equal.
virtual bool inside(const Point &pos) const =0
Is the point in the geometry.
Geometry & operator=(const Geometry &)=delete
Geometry(Geometry &&)=delete
virtual Point centroid() const =0
Return the centroid.
virtual std::pair< Point, Point > box() const =0
Return the bounding box.
virtual void registerChildObjects(AMP::IO::RestartManager *manager) const
Register child objects.
virtual void displace(const double *x)=0
Displace the entire geometry.
virtual double volume() const =0
Return the volume.
virtual AMP::Mesh::GeomType getGeomType() const
Get the geometric type for the geometry.
bool operator!=(const Geometry &rhs) const
Check if two geometries are not equal.
Definition Geometry.h:151
const uint8_t d_physicalDim
Definition Geometry.h:200
virtual bool isConvex() const =0
Is the object convex.
static std::shared_ptr< AMP::Geometry::Geometry > buildGeometry(std::shared_ptr< const AMP::Database > db)
Create a geometry.
virtual Point surfaceNorm(const Point &x) const =0
Return the outward normal to a surface.
uint8_t getDim() const
Get the number of dimensions for the object.
Definition Geometry.h:42
virtual uint64_t getID() const
Return a unique hash id.
Geometry(const Geometry &)=default
virtual Point nearest(const Point &pos) const =0
Calculate the nearest point on the surface.
virtual double distance(const Point &pos, const Point &dir) const =0
Calculate the distance to the object given a ray.
virtual int NSurface() const =0
Get the number of surfaces.
Geometry(int ndim)
Empty constructor for the base class.
Definition Geometry.h:190
Geometry(int64_t fid)
Initialize the base class from file.
virtual std::unique_ptr< AMP::Geometry::Geometry > clone() const =0
Clone the object.
virtual std::string getName() const =0
Get the name of the geometry.
Class to manage reading/writing restart data.
GeomType
Enumeration for basic mesh-based quantities.
Definition MeshID.h:12



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:40.
Comments on this page