Advanced Multi-Physics (AMP)
On-Line Documentation
RotationalGeometry.h
Go to the documentation of this file.
1#ifndef included_AMP_RotationalGeometry
2#define included_AMP_RotationalGeometry
3
4#include "AMP/geometry/Geometry.h"
5
6
7namespace AMP::Geometry {
8
9
16{
17public:
22 explicit RotationalGeometry( std::shared_ptr<LogicalGeometry> geom ) : d_geom( geom )
23 {
24 d_logicalDim = geom->getLogicalDim();
25 d_isPeriodic = geom->getPeriodicDim();
26 d_ids = geom->getLogicalSurfaceIds();
27 }
28
29public: // Functions inherited from Geometry
30 std::string getName() const { return "RotationalGeometry<" + d_geom->getName() + ">"; }
31 bool isConvex() const { return d_geom->isConvex(); }
32 Point nearest( const Point &x ) const { return out( d_geom->nearest( to( x ) ) ); }
33 double distance( const Point &x, const Point &dir ) const
34 {
35 return d_geom->distance( to( x ), rotateDir( dir ) );
36 }
37 bool inside( const Point &x ) const { return d_geom->inside( to( x ) ); }
38 int NSurface() const { return d_geom->NSurface(); }
39 int surface( const Point &x ) const { return d_geom->surface( to( x ) ); }
40 Point surfaceNorm( const Point &x ) const { return out( d_geom->surfaceNorm( to( x ) ) ); }
41 Point logical( const Point &x ) const final {return out( d_geom->logical( to( x ) ); }
42 Point physical( const Point &x ) const override final
43 { return out( d_geom->physical( to( x ) );
44 }
45 Point centroid() const override final { return out( d_geom->centroid() ); }
46 std::pair<Point, Point> box() const override final;
47 double volume() const override final { return d_geom->volume(); }
48 void displace( const double *x ) override final;
49 std::vector<int> getLogicalGridSize( const std::vector<int> &x ) const override final;
50 virtual std::vector<int>
51 getLogicalGridSize( const std::vector<double> &res ) const override final
52 {
53 return d_geom->res();
54 }
55 std::unique_ptr<AMP::Geometry::Geometry> clone() const override final
56 {
57 return d_geom->clone();
58 }
59
60private: // Internal data
61 std::shared_ptr<LogicalGeometry> d_geom;
62
63private:
64 // Private constructor
66
67 // Rotate coordinates
68 Point in( const Point &x );
69 Point out( const Point &x );
70 Point rotateDir( const Point &dir );
71};
72
73
74} // namespace AMP::Geometry
75
76#endif
A class used to abstract away logical geometry based operations.
const std::array< int, 6 > d_ids
A geometry to rotate a geometry object about the centroid.
double distance(const Point &x, const Point &dir) const
Calculate the distance to the object given a ray.
Point rotateDir(const Point &dir)
RotationalGeometry(std::shared_ptr< LogicalGeometry > geom)
Construct a RotationalGeometry geometry.
bool isConvex() const
Is the object convex.
std::shared_ptr< LogicalGeometry > d_geom
int NSurface() const
Get the number of surfaces.
std::pair< Point, Point > box() const override final
Return the bounding box.
Point physical(const Point &x) const override final
Return the physical position.
double volume() const override final
Return the volume.
Point surfaceNorm(const Point &x) const
Return the outward normal to a surface.
std::string getName() const
Get the name of the geometry.
Point logical(const Point &x) const final
Return the logical position.
Point centroid() const override final
Return the centroid.
Point nearest(const Point &x) const
Calculate the nearest point on the surface.
int surface(const Point &x) const
Get the surface id.
std::vector< int > getLogicalGridSize(const std::vector< int > &x) const override final
std::unique_ptr< AMP::Geometry::Geometry > clone() const override final
Clone the object.
bool inside(const Point &x) const
Is the point in the geometry.
void displace(const double *x) override final
Displace the entire geometry.
virtual std::vector< int > getLogicalGridSize(const std::vector< double > &res) const override final
Return the logical grid size.



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