Advanced Multi-Physics (AMP)
On-Line Documentation
CircleFrustum.h
Go to the documentation of this file.
1#ifndef included_AMP_Geometry_CircleFrustum
2#define included_AMP_Geometry_CircleFrustum
3
4#include "AMP/geometry/LogicalGeometry.h"
5
6#include <array>
7#include <vector>
8
9
10namespace AMP::Geometry {
11
12
18class CircleFrustum final : public LogicalGeometry
19{
20public:
25 explicit CircleFrustum( std::shared_ptr<const AMP::Database> db );
26
33 explicit CircleFrustum( const std::array<double, 2> &r, int dir, double height );
34
36 CircleFrustum( int64_t );
37
39 CircleFrustum( const CircleFrustum & ) = default;
40
41public: // Functions inherited from Geometry
42 std::string getName() const override final { return "CircleFrustum"; }
43 bool isConvex() const override final { return true; }
44 Point nearest( const Point &pos ) const override final;
45 double distance( const Point &pos, const Point &dir ) const override final;
46 bool inside( const Point &pos ) const override final;
47 int NSurface() const override final { return 3; }
48 int surface( const Point &x ) const override final;
49 Point surfaceNorm( const Point &x ) const override final;
50 Point logical( const Point &x ) const override final;
51 Point physical( const Point &x ) const override final;
52 Point centroid() const override final;
53 std::pair<Point, Point> box() const override final;
54 double volume() const override final;
55 void displace( const double *x ) override final;
56 ArraySize getLogicalGridSize( const ArraySize &x ) const override final;
57 ArraySize getLogicalGridSize( const std::vector<double> &res ) const override final;
58 std::unique_ptr<AMP::Geometry::Geometry> clone() const override final;
59 bool operator==( const Geometry &rhs ) const override final;
60 void writeRestart( int64_t ) const override;
61
62protected: // Internal data
63 uint8_t d_dir = 0; // The direction of the center axis
64 double d_h = 0; // The height of the frustrum
65 std::array<double, 2> d_r = { 0, 0 }; // The two radii
66 std::array<double, 3> d_offset = { 0, 0, 0 }; // The offset
67 double d_theta = 0; // Apex angle
68
69private:
70 // Private constructor
71 CircleFrustum() = delete;
72 // Initialize the data
73 void initialize( int dir, const std::array<double, 2> &r, double h );
74 // Convert a point/angle to the reference frame (does not subtract offset)
75 Point convertToReference( const Point & ) const;
76 // Convert a point/angle from the reference frame (does not add offset)
78};
79
80
81} // namespace AMP::Geometry
82
83#endif
Simple class to store the array dimensions.
Definition ArraySize.h:138
A geometry for a circular frustum.
int surface(const Point &x) const override final
Get the surface id.
CircleFrustum(const std::array< double, 2 > &r, int dir, double height)
Construct a CircleFrustum geometry.
Point physical(const Point &x) const override final
Return the physical position.
CircleFrustum(std::shared_ptr< const AMP::Database > db)
Construct a CircleFrustum geometry.
void displace(const double *x) override final
Displace the entire geometry.
CircleFrustum(int64_t)
Construct from restart.
CircleFrustum(const CircleFrustum &)=default
Copy contructor.
std::array< double, 2 > d_r
Point logical(const Point &x) const override final
Return the logical position.
int NSurface() const override final
Get the number of surfaces.
Point convertToReference(const Point &) const
Point centroid() const override final
Return the centroid.
void initialize(int dir, const std::array< double, 2 > &r, double h)
bool isConvex() const override final
Is the object convex.
Point surfaceNorm(const Point &x) const override final
Return the outward normal to a surface.
Point nearest(const Point &pos) const override final
Calculate the nearest point on the surface.
std::pair< Point, Point > box() const override final
Return the bounding box.
Point convertFromReference(const Point &) const
std::unique_ptr< AMP::Geometry::Geometry > clone() const override final
Clone the object.
ArraySize getLogicalGridSize(const ArraySize &x) const override final
Return the logical grid size.
std::array< double, 3 > d_offset
bool inside(const Point &pos) const override final
Is the point in the geometry.
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.
std::string getName() const override final
Get the name of the geometry.
void writeRestart(int64_t) const override
Write restart data to file.
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