Advanced Multi-Physics (AMP)
On-Line Documentation
Parallelepiped.h
Go to the documentation of this file.
1#ifndef included_AMP_Geometry_Parallelepiped
2#define included_AMP_Geometry_Parallelepiped
3
4#include "AMP/geometry/LogicalGeometry.h"
5
6#include <array>
7#include <vector>
8
9
10namespace AMP::Geometry {
11
12
19class Parallelepiped final : public LogicalGeometry
20{
21public:
26 explicit Parallelepiped( std::shared_ptr<const AMP::Database> db );
27
29 Parallelepiped( int64_t );
30
31public: // Functions inherited from Geometry
32 std::string getName() const override final { return "Parallelepiped"; }
33 bool isConvex() const override final { return true; }
34 Point nearest( const Point &pos ) const override final;
35 double distance( const Point &pos, const Point &dir ) const override final;
36 bool inside( const Point &pos ) const override final;
37 int NSurface() const override final { return 6; }
38 int surface( const Point & ) const override final;
39 Point surfaceNorm( const Point & ) const override final;
40 Point logical( const Point &x ) const override final;
41 Point physical( const Point &x ) const override final;
42 Point centroid() const override final;
43 std::pair<Point, Point> box() const override final;
44 double volume() const override final;
45 void displace( const double *x ) override final;
46 ArraySize getLogicalGridSize( const ArraySize &x ) const override final;
47 ArraySize getLogicalGridSize( const std::vector<double> &res ) const override final;
48 std::unique_ptr<AMP::Geometry::Geometry> clone() const override final;
49 bool operator==( const Geometry &rhs ) const override final;
50 void writeRestart( int64_t ) const override;
51
52protected:
53 // Internal data
54 std::array<double, 3> d_a; // First edge vector
55 std::array<double, 3> d_b; // Second edge vector
56 std::array<double, 3> d_c; // Third edge vector
57 std::array<double, 3> d_offset; // Offset
58 std::array<double, 9> d_M_inv; // Inverse matrix used to compute logical coordinates
59 double d_V; // Cached volume
60 AMP::Mesh::Point d_n_ab; // Normal to the plane defined by a-b
61 AMP::Mesh::Point d_n_ac; // Normal to the plane defined by a-c
62 AMP::Mesh::Point d_n_bc; // Normal to the plane defined by b-c
63
64private:
65 // Private constructor
67};
68
69
70} // namespace AMP::Geometry
71
72#endif
Simple class to store the array dimensions.
Definition ArraySize.h:138
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.
A class used to describe a Parallelepiped.
Point centroid() const override final
Return the centroid.
bool isConvex() const override final
Is the object convex.
ArraySize getLogicalGridSize(const ArraySize &x) const override final
Return the logical grid size.
double volume() const override final
Return the volume.
std::array< double, 3 > d_b
int surface(const Point &) const override final
Get the surface id.
int NSurface() const override final
Get the number of surfaces.
Point physical(const Point &x) const override final
Return the physical position.
Point surfaceNorm(const Point &) const override final
Return the outward normal to a surface.
std::pair< Point, Point > box() const override final
Return the bounding box.
std::array< double, 3 > d_c
std::unique_ptr< AMP::Geometry::Geometry > clone() const override final
Clone the object.
bool inside(const Point &pos) const override final
Is the point in the geometry.
std::array< double, 3 > d_offset
Parallelepiped(int64_t)
Construct from restart.
Point logical(const Point &x) const override final
Return the logical position.
double distance(const Point &pos, const Point &dir) const override final
Calculate the distance to the object given a ray.
Point nearest(const Point &pos) const override final
Calculate the nearest point on the surface.
void writeRestart(int64_t) const override
Write restart data to file.
std::string getName() const override final
Get the name of the geometry.
void displace(const double *x) override final
Displace the entire geometry.
Parallelepiped(std::shared_ptr< const AMP::Database > db)
Construct a Parallelepiped geometry.
std::array< double, 9 > d_M_inv
std::array< double, 3 > d_a



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