Advanced Multi-Physics (AMP)
On-Line Documentation
Cylinder.h
Go to the documentation of this file.
1#ifndef included_AMP_Geometry_Cylinder
2#define included_AMP_Geometry_Cylinder
3
4#include "AMP/geometry/LogicalGeometry.h"
5
6#include <array>
7#include <vector>
8
9
10namespace AMP::Geometry {
11
12
18class Cylinder final : public LogicalGeometry
19{
20public:
25 explicit Cylinder( std::shared_ptr<const AMP::Database> db );
26
33 explicit Cylinder( double r, double z_min, double z_max );
34
36 Cylinder( int64_t );
37
38public: // Functions inherited from Geometry
39 std::string getName() const override final { return "Cylinder"; }
40 bool isConvex() const override final { return true; }
41 Point nearest( const Point &pos ) const override final;
42 double distance( const Point &pos, const Point &dir ) const override final;
43 bool inside( const Point &pos ) const override final;
44 int NSurface() const override final { return 3; }
45 int surface( const Point &x ) const override final;
46 Point surfaceNorm( const Point &x ) const override final;
47 Point logical( const Point &x ) const override final;
48 Point physical( const Point &x ) const override final;
49 Point centroid() const override final;
50 std::pair<Point, Point> box() const override final;
51 double volume() const override final;
52 void displace( const double *x ) override final;
53 ArraySize getLogicalGridSize( const ArraySize &x ) const override final;
54 ArraySize getLogicalGridSize( const std::vector<double> &res ) const override final;
55 std::unique_ptr<AMP::Geometry::Geometry> clone() const override final;
56 bool operator==( const Geometry &rhs ) const override final;
57 void writeRestart( int64_t ) const override;
58
59protected: // Internal data
60 int d_method = 2;
61 double d_r = 0;
62 double d_z_min = 0;
63 double d_z_max = 0;
64 std::array<double, 3> d_offset = { 0, 0, 0 };
65 std::array<double, 2> d_chamfer = { 0, 0 };
66
67private: // Private functions
69 double getR( double z ) const;
70};
71
72
73} // namespace AMP::Geometry
74
75#endif
Simple class to store the array dimensions.
Definition ArraySize.h:138
ArraySize getLogicalGridSize(const ArraySize &x) const override final
Return the logical grid size.
double volume() const override final
Return the volume.
double distance(const Point &pos, const Point &dir) const override final
Calculate the distance to the object given a ray.
Cylinder(int64_t)
Construct from restart.
std::pair< Point, Point > box() const override final
Return the bounding box.
std::array< double, 3 > d_offset
Definition Cylinder.h:64
std::array< double, 2 > d_chamfer
Definition Cylinder.h:65
int NSurface() const override final
Get the number of surfaces.
Definition Cylinder.h:44
std::unique_ptr< AMP::Geometry::Geometry > clone() const override final
Clone the object.
Point physical(const Point &x) const override final
Return the physical position.
Point surfaceNorm(const Point &x) const override final
Return the outward normal to a surface.
std::string getName() const override final
Get the name of the geometry.
Definition Cylinder.h:39
Cylinder(double r, double z_min, double z_max)
Construct a Cylinder geometry.
double getR(double z) const
Cylinder(std::shared_ptr< const AMP::Database > db)
Construct a Cylinder geometry.
Point nearest(const Point &pos) const override final
Calculate the nearest point on the surface.
bool isConvex() const override final
Is the object convex.
Definition Cylinder.h:40
bool inside(const Point &pos) const override final
Is the point in the geometry.
void displace(const double *x) override final
Displace the entire geometry.
int surface(const Point &x) const override final
Get the surface id.
Point centroid() const override final
Return the centroid.
void writeRestart(int64_t) const override
Write restart data to file.
Point logical(const Point &x) const override final
Return the logical position.
A class used to abstract away geometry information from an application or mesh.
Definition Geometry.h:29
A class used to abstract away logical geometry based operations.



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