1#ifndef included_AMP_Geometry_Box
2#define included_AMP_Geometry_Box
4#include "AMP/geometry/LogicalGeometry.h"
13std::unique_ptr<AMP::Geometry::Geometry>
buildBox( std::shared_ptr<const AMP::Database> db );
21template<std::
size_t NDIM>
29 explicit Box( std::shared_ptr<const AMP::Database> db );
35 explicit Box(
const std::vector<double> &range );
48 bool isConvex() const override final {
return true; }
52 int NSurface() const override final {
return 2 * NDIM; }
59 double volume() const override final;
64 bool operator==( const
Geometry &rhs ) const override;
81template<
std::
size_t NDIM>
89 explicit Grid( std::shared_ptr<const AMP::Database> db );
95 explicit Grid(
const std::vector<std::vector<double>> &coord );
111 std::unique_ptr<AMP::Geometry::Geometry>
clone() const override final;
112 bool operator==( const
Geometry &rhs ) const override final;
116 std::array<
std::vector<
double>, NDIM> d_coord;
Simple class to store the array dimensions.
double volume() const override final
Return the volume.
std::pair< Point, Point > box() const override final
Return the bounding box.
Box< NDIM > & operator=(Box< NDIM > &&range)=default
Point physical(const Point &x) const override
Return the physical position.
Box(Box< NDIM > &&range)=default
void displace(const double *x) override
Displace the entire geometry.
Box(const Box< NDIM > &range)=default
std::string getName() const override
Get the name of the geometry.
int NSurface() const override final
Get the number of surfaces.
bool inside(const Point &pos) const override final
Is the point in the geometry.
ArraySize getLogicalGridSize(const ArraySize &x) const override final
Return the logical grid size.
Box< NDIM > & operator=(const Box< NDIM > &range)=default
Point centroid() const override final
Return the centroid.
Box(int64_t)
ConstructGrid from restart.
Point logical(const Point &x) const override
Return the logical position.
Box(std::shared_ptr< const AMP::Database > db)
Construct a Box geometry.
double distance(const Point &pos, const Point &dir) const override final
Calculate the distance to the object given a ray.
std::array< double, 6 > d_range
Box(const std::vector< double > &range)
Construct a box.
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.
int surface(const Point &x) const override final
Get the surface id.
void writeRestart(int64_t) const override
Write restart data to file.
bool isConvex() const override final
Is the object convex.
std::unique_ptr< AMP::Geometry::Geometry > clone() const override
Clone the object.
A class used to abstract away geometry information from an application or mesh.
Grid< NDIM > & operator=(Grid< NDIM > &&rhs)=default
Grid(Grid< NDIM > &&rhs)=default
void displace(const double *x) override final
Displace the entire geometry.
Grid< NDIM > & operator=(const Grid< NDIM > &rhs)=default
Grid(std::shared_ptr< const AMP::Database > db)
Construct a Grid geometry.
Point physical(const Point &x) const override final
Return the physical position.
Grid(const Grid< NDIM > &rhs)=default
Point logical(const Point &x) const override final
Return the logical position.
std::string getName() const override
Get the name of the geometry.
std::unique_ptr< AMP::Geometry::Geometry > clone() const override final
Clone the object.
Grid(const std::vector< std::vector< double > > &coord)
Construct a grid geometry.
Grid(int64_t)
ConstructGrid from restart.
A class used to abstract away logical geometry based operations.
std::unique_ptr< AMP::Geometry::Geometry > buildBox(std::shared_ptr< const AMP::Database > db)