AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Represents a polyhedron defined by an array of points and optionally their neighbors (a point is a neighbor of another point if there is an edge between them) More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/primal/geometry/Polyhedron.hpp>
Public Types | |
using | PointType = Point< T, NDIMS > |
using | VectorType = Vector< T, NDIMS > |
using | NumArrayType = NumericArray< T, NDIMS > |
Public Member Functions | |
AXOM_HOST_DEVICE | Polyhedron () |
AXOM_HOST_DEVICE int | numVertices () const |
AXOM_HOST_DEVICE int | addVertex (const PointType &pt) |
Appends a vertex to the list of vertices. More... | |
AXOM_HOST_DEVICE void | addNeighbors (const PointType &pt, std::initializer_list< axom::int8 > nbrs) |
Stores nbrs as the neighbors of vertex pt. If vertex pt is not in the polyhedron, neighbors are not added. More... | |
AXOM_HOST_DEVICE void | addNeighbors (int vtxId, std::initializer_list< axom::int8 > nbrs) |
Stores nbrs as the neighbors of vertex at a given index. More... | |
AXOM_HOST_DEVICE void | addNeighbors (int vtxId, int nbr) |
Adds a single nbr as the neighbor of vertex at a given index. More... | |
AXOM_HOST_DEVICE void | clear () |
Coords & | getVertices () |
AXOM_HOST_DEVICE PointType & | operator[] (int idx) |
AXOM_HOST_DEVICE const PointType & | operator[] (int idx) const |
AXOM_HOST_DEVICE Neighbors & | getNeighbors () |
AXOM_HOST_DEVICE int | getNumNeighbors (int i) const |
AXOM_HOST_DEVICE Neighbors::VertexNbrs & | getNeighbors (int i) |
AXOM_HOST_DEVICE const Neighbors::VertexNbrs & | getNeighbors (int i) const |
AXOM_HOST_DEVICE PointType | centroid () const |
Computes the centroid as the average of the polyhedron's vertex positions. More... | |
AXOM_HOST_DEVICE double | volume () const |
Finds the volume of the polyhedron. More... | |
std::ostream & | print (std::ostream &os) const |
Simple formatted print of a polyhedron instance. More... | |
AXOM_HOST_DEVICE bool | isValid () const |
Simple check for validity of a polyhedron. More... | |
AXOM_HOST_DEVICE bool | hasNeighbors () const |
Check if vertex neighbors information is available. More... | |
Static Public Attributes | |
static constexpr int | MAX_VERTS = NeighborCollection::MAX_VERTS |
Represents a polyhedron defined by an array of points and optionally their neighbors (a point is a neighbor of another point if there is an edge between them)
T | the coordinate type, e.g., double, float, etc. |
NDIMS | the number of dimensions |
4-----—7 /| /| / | / | 5-----—6 | | 0--—|–3 | / | / |/ |/ 1-----—2
For example, vertex 5 above should have neighbors (4,1,6).
using axom::primal::Polyhedron< T, NDIMS >::PointType = Point<T, NDIMS> |
using axom::primal::Polyhedron< T, NDIMS >::VectorType = Vector<T, NDIMS> |
using axom::primal::Polyhedron< T, NDIMS >::NumArrayType = NumericArray<T, NDIMS> |
|
inline |
Default constructor for an empty polyhedron
|
inline |
Return the number of vertices in the polyhedron
Referenced by axom::primal::compute_bounding_box(), and axom::quest::IntersectionShaper::setExecPolicy().
|
inline |
Appends a vertex to the list of vertices.
References AXOM_HOST_DEVICE, and SLIC_ASSERT.
Referenced by axom::quest::IntersectionShaper::setExecPolicy().
|
inline |
Stores nbrs as the neighbors of vertex pt. If vertex pt is not in the polyhedron, neighbors are not added.
[in] | pt | The vertex to add neighbors |
[in] | nbrs | The neighbors to add to the list of neighbors |
References AXOM_HOST_DEVICE.
Referenced by axom::quest::IntersectionShaper::setExecPolicy().
|
inline |
Stores nbrs as the neighbors of vertex at a given index.
[in] | vtxId | The vertex id to add neighbors |
[in] | nbrs | The neighbors to add to the list of neighbors |
References AXOM_HOST_DEVICE.
|
inline |
Adds a single nbr as the neighbor of vertex at a given index.
[in] | vtxId | The vertex id to add the neighbor |
[in] | nbr | The neighbor to add to the list of neighbors |
|
inline |
Clears the list of vertices and neighbors
|
inline |
Retrieves the vertices
|
inline |
Retrieves the vertex at index idx
|
inline |
Retrieves the vertex at index idx
|
inline |
Retrieves the neighbors
|
inline |
References AXOM_HOST_DEVICE.
|
inline |
Retrieves the neighbors for vertex i
References AXOM_HOST_DEVICE.
|
inline |
Retrieves the neighbors for vertex i
References AXOM_HOST_DEVICE.
|
inline |
Computes the centroid as the average of the polyhedron's vertex positions.
References AXOM_HOST_DEVICE, and SLIC_ASSERT.
Referenced by axom::quest::IntersectionShaper::setExecPolicy().
|
inline |
Finds the volume of the polyhedron.
References axom::numerics::cross_product(), axom::primal::Vector< T, NDIMS >::dot(), axom::primal::NeighborCollection::MAX_VERTS, and SLIC_CHECK_MSG.
Referenced by axom::quest::IntersectionShaper::setExecPolicy().
|
inline |
Simple formatted print of a polyhedron instance.
os | The output stream to write to |
References AXOM_HOST_DEVICE, and axom::primal::NeighborCollection::getNeighbors().
|
inline |
Simple check for validity of a polyhedron.
Initial check is that the polyhedron has four or more vertices
References AXOM_HOST_DEVICE.
|
inline |
Check if vertex neighbors information is available.
Checks if neighbors is not empty
|
static |