AXOM
Axom provides a robust, flexible software infrastructure for the development of multiphysics applications and computational tools.

Namespaces  
detail  
Classes  
class  InOutOctree 
class  PointInCell 
A class to accelerate PointInCell queries on a computational mesh. More...  
class  PointInCellTraits 
A traits class for the mesh associated with a PointInCell query. More...  
class  PSTLReader 
class  SignedDistance 
class  STLReader 
A simple reader for an STL file encoded in the ascii or binary format. More...  
Enumerations  
enum  SearchStatus { NEIGHBOR_NOT_FOUND = 1 } 
enum  WatertightStatus : signed char { WatertightStatus::WATERTIGHT = 0, WatertightStatus::NOT_WATERTIGHT, WatertightStatus::CHECK_FAILED } 
Functions  
detail::Triangle3  getMeshTriangle (axom::IndexType i, detail::UMesh *surface_mesh) 
Nearest Neighbor query  
void  all_nearest_neighbors (const double *x, const double *y, const double *z, const int *region, int n, double limit, int *neighbor, double *sqdistance) 
Given a list of point locations and regions, for each point, find the closest point in a different region within a given search radius. More...  
Mesh test and repair  
void  findTriMeshIntersections (mint::UnstructuredMesh< mint::SINGLE_SHAPE > *surface_mesh, std::vector< std::pair< int, int >> &intersections, std::vector< int > °enerateIndices, int spatialIndexResolution=0, double intersectionThreshold=1E8) 
Find selfintersections and degenerate triangles in a surface mesh utilizing a Bounding Volume Hierarchy. More...  
WatertightStatus  isSurfaceMeshWatertight (mint::UnstructuredMesh< mint::SINGLE_SHAPE > *surface_mesh) 
Check a surface mesh for holes using its face relation. More...  
void  weldTriMeshVertices (mint::UnstructuredMesh< mint::SINGLE_SHAPE > **surface_mesh, double eps) 
Mesh repair function to weld vertices that are closer than eps. More...  
InOut query  initialization and finalization functions  
int  inout_init (const std::string &file, MPI_Comm comm=MPI_COMM_SELF) 
Initializes the quest inout query from a mesh file. More...  
int  inout_init (mint::Mesh *&mesh, MPI_Comm comm=MPI_COMM_SELF) 
Initialize the inout query using a preloaded mesh. More...  
int  inout_finalize () 
Finalizes the inout query. More...  
bool  inout_initialized () 
Predicate to test whether the inout query has been initialized. More...  
InOut query  properties and querying functions  
 
bool  inout_evaluate (double x, double y, double z=0.) 
Tests if the point (x, y, z) is inside the contained volume. More...  
int  inout_evaluate (const double *x, const double *y, const double *z, int npoints, int *res) 
Tests an array of points for containment. More...  
int  inout_mesh_min_bounds (double *coords) 
Returns the lower coordinates of the mesh's bounding box. More...  
int  inout_mesh_max_bounds (double *coords) 
Returns the upper coordinates of the mesh's bounding box. More...  
int  inout_mesh_center_of_mass (double *coords) 
Returns the center of mass of the mesh. More...  
int  inout_get_dimension () 
Gets the spatial dimension of the query. More...  
InOut query  setup options and parameters  
 
int  inout_set_verbose (bool verbosity) 
Enables/disables verbose logging output. More...  
int  inout_set_vertex_weld_threshold (double thresh) 
Sets the cutoff distance for welding vertices during initialization. More...  
Signed Distance Query Initialization Methods  
int  signed_distance_init (const std::string &file, MPI_Comm comm=MPI_COMM_SELF) 
Initializes the Signed Distance Query with a surface given in an STL formatted file. More...  
int  signed_distance_init (const mint::Mesh *m, MPI_Comm comm=MPI_COMM_SELF) 
Initializes the Signed Distance Query with the given surface mesh. More...  
bool  signed_distance_initialized () 
Checks if the Signed Distance Query has been initialized. More...  
Signed Distance Query Options  
void  signed_distance_set_dimension (int dim) 
Sets the dimension for the Signed Distance Query. More...  
void  signed_distance_set_closed_surface (bool status) 
Indicates whether the input to the signed distance consists of a watertight surface mesh, or not. More...  
void  signed_distance_set_compute_signs (bool computeSign) 
Sets whether the distance query should compute or ignore the sign. More...  
void  signed_distance_set_max_levels (int maxLevels) 
Sets the maximum levels of subdivision for the BVH decomposition. More...  
void  signed_distance_set_max_occupancy (int threshold) 
Sets threshold on the max number of items per BVH bin. This option controls the BVH decomposition. More...  
void  signed_distance_set_verbose (bool status) 
Enables/Disables verbose output for the Signed Distance Query. More...  
void  signed_distance_use_shared_memory (bool status) 
Enable/Disable the use of MPI3 onnode shared memory for storing the surface mesh. By default this option is disabled. More...  
Signed Distance Query Evaluation Methods  
double  signed_distance_evaluate (double x, double y, double z=0.0) 
Evaluates the signed distance function at the given point. More...  
void  signed_distance_evaluate (const double *x, const double *y, const double *z, int npoints, double *phi) 
Evaluates the signed distance function at the given set of points. More...  
void  signed_distance_get_mesh_bounds (double *lo, double *hi) 
Computes the bounds of the specified input mesh supplied to the Signed Distance Query. More...  
Signed Distance Query Finalization Methods  
void  signed_distance_finalize () 
Finalizes the SignedDistance query. More...  
Variables  
constexpr int  QUEST_INOUT_SUCCESS = 0 
constexpr int  QUEST_INOUT_FAILED = 1 

strong 
void axom::quest::all_nearest_neighbors  (  const double *  x, 
const double *  y,  
const double *  z,  
const int *  region,  
int  n,  
double  limit,  
int *  neighbor,  
double *  sqdistance  
) 
Given a list of point locations and regions, for each point, find the closest point in a different region within a given search radius.
[in]  x  Xcoordinates of input points 
[in]  y  Ycoordinates of input points 
[in]  z  Zcoordinates of input points 
[in]  region  Region of each point 
[in]  n  Number of points 
[in]  limit  Max distance for allnearestneighbors query 
[out]  neighbor  Index of nearest neighbor not in the same class (or NEIGHBOR_NOT_FOUND) 
[out]  sqdistance  Squared distance to nearest neighbor 
This method inserts all points p at (x[i], y[i], z[i]) into a UniformGrid index. Then for each point p, it gets the UniformGrid bins that overlap the box (p  (limit, limit, limit), p + (limit, limit, limit). The method compares p to each point in this list of bins and returns the index of the closest point.
We expect the use of the UniformGrid will result in a substantial time savings over a bruteforce alltoall algorithm, but the query's run time is dependent on the point distribution.

inline 
References AXOM_LAMBDA, AXOM_NOT_USED, AXOM_PERF_MARK_FUNCTION, AXOM_PERF_MARK_SECTION, axom::spin::BVH< NDIMS, ExecSpace, FloatType >::build(), axom::primal::compute_bounding_box(), axom::copy(), axom::deallocate(), axom::primal::Triangle< T, NDIMS >::degenerate(), axom::spin::BVH< NDIMS, ExecSpace, FloatType >::findBoundingBoxes(), findTriMeshIntersections(), axom::mint::UnstructuredMesh< TOPO >::getCellNodeIDs(), axom::numerics::Matrix< T >::getColumn(), axom::mint::UnstructuredMesh< TOPO >::getCoordinateArray(), axom::getDefaultAllocatorID(), axom::primal::BoundingBox< T, NDIMS >::getMax(), axom::primal::BoundingBox< T, NDIMS >::getMin(), axom::mint::UnstructuredMesh< TOPO >::getNumberOfCellNodes(), axom::mint::UnstructuredMesh< TOPO >::getNumberOfCells(), axom::primal::intersect(), isSurfaceMeshWatertight(), axom::setDefaultAllocator(), SLIC_ASSERT, SLIC_INFO, weldTriMeshVertices(), axom::mint::X_COORDINATE, axom::mint::Y_COORDINATE, axom::mint::Z_COORDINATE, and axom::internal::ZERO.
void axom::quest::findTriMeshIntersections  (  mint::UnstructuredMesh< mint::SINGLE_SHAPE > *  surface_mesh, 
std::vector< std::pair< int, int >> &  intersections,  
std::vector< int > &  degenerateIndices,  
int  spatialIndexResolution = 0 , 

double  intersectionThreshold = 1E8 

) 
Find selfintersections and degenerate triangles in a surface mesh utilizing a Bounding Volume Hierarchy.
[in]  surface_mesh  A triangle mesh in three dimensions 
[out]  intersection  Pairs of indices of intersecting mesh triangles 
[out]  degenerateIndices  indices of degenerate mesh triangles 
[in]  intersectionThreshold  Tolerance threshold for triangle intersection tests (default: 1E8) After running this function over a surface mesh, intersection will be filled with pairs of indices of intersecting triangles and degenerateIndices will be filled with the indices of the degenerate triangles in the mesh. Triangles that share vertex pairs (adjacent triangles in a watertight surface mesh) are not reported as intersecting. Degenerate triangles are not reported as intersecting other triangles. 
Find selfintersections and degenerate triangles in a surface mesh utilizing a Uniform Grid.
[in]  surface_mesh  A triangle mesh in three dimensions 
[out]  intersection  Pairs of indices of intersecting mesh triangles 
[out]  degenerateIndices  indices of degenerate mesh triangles 
[in]  spatialIndexResolution  The grid resolution for the index structure (default: 0) 
[in]  intersectionThreshold  Tolerance threshold for triangle intersection tests (default: 1E8) 
After running this function over a surface mesh, intersection will be filled with pairs of indices of intersecting triangles and degenerateIndices will be filled with the indices of the degenerate triangles in the mesh. Triangles that share vertex pairs (adjacent triangles in a watertight surface mesh) are not reported as intersecting. Degenerate triangles are not reported as intersecting other triangles.
This function uses a quest::UniformGrid spatial index. Input spatialIndexResolution specifies the bin size for the UniformGrid. The default value of 0 causes this routine to calculate a heuristic bin size based on the cube root of the number of cells in the mesh.
Referenced by getMeshTriangle().
WatertightStatus axom::quest::isSurfaceMeshWatertight  (  mint::UnstructuredMesh< mint::SINGLE_SHAPE > *  surface_mesh  ) 
Check a surface mesh for holes using its face relation.
[in]  surface_mesh  A surface mesh in three dimensions 
Referenced by getMeshTriangle().
void axom::quest::weldTriMeshVertices  (  mint::UnstructuredMesh< mint::SINGLE_SHAPE > **  surface_mesh, 
double  eps  
) 
Mesh repair function to weld vertices that are closer than eps.
[in,out]  surface_mesh  A pointer to a pointer to a triangle mesh 
[in]  eps  Distance threshold for welding vertices (using the max norm) 
This utility function repairs an input triangle mesh (embedded in three dimensional space) by 'welding' vertices that are closer than eps. The vertices are quantized to an integer lattice with spacing eps and vertices that fall into the same cell on this lattice are identified. All identified vertices are given the coordinates of the first such vertex and all incident triangles use the same index for this vertex.
The input mesh can be a "soup of triangles", where the vertices of adjacent triangles have distinct indices. After running this function, vertices that are closer than eps are welded, and their incident triangles use the new vertex indices. Thus, the output is an "indexed triangle mesh".
This function also removes degenerate triangles from the mesh. These are triangles without three distinct vertices after the welding.
Referenced by getMeshTriangle().
int axom::quest::inout_init  (  const std::string &  file, 
MPI_Comm  comm = MPI_COMM_SELF 

) 
Initializes the quest inout query from a mesh file.
[in]  file  Path to an STL file containing the surface mesh 
[in]  comm  The MPI communicator (when running in parallel) 
int axom::quest::inout_init  (  mint::Mesh *&  mesh, 
MPI_Comm  comm = MPI_COMM_SELF 

) 
Initialize the inout query using a preloaded mesh.
[in,out]  mesh  Pointer to the input mesh. This pointer will be updated during this invocation 
[in]  comm  The MPI communicator (when running in parallel) 
int axom::quest::inout_finalize  (  ) 
Finalizes the inout query.
bool axom::quest::inout_initialized  (  ) 
Predicate to test whether the inout query has been initialized.
bool axom::quest::inout_evaluate  (  double  x, 
double  y,  
double  z = 0. 

) 
Tests if the point (x, y, z) is inside the contained volume.
[in]  x  The xcoordinate of the query point 
[in]  y  The ycoordinate of the query point 
[in]  z  The zcoordinate of the query point 
int axom::quest::inout_evaluate  (  const double *  x, 
const double *  y,  
const double *  z,  
int  npoints,  
int *  res  
) 
Tests an array of points for containment.
Upon successful completion, entries in array res will have the value 1 for points that are inside and value 0 otherwise.
[in]  x  Array of xcoordinates for the query points 
[in]  y  Array of ycoordinates for the query points 
[in]  z  Array of zcoordinates for the query points 
[in]  npoints  The number of points to test 
[out]  res  An array of results. Each entry has value 1 if the corresponding point is inside or on the mesh and 0 otherwise. 
int axom::quest::inout_mesh_min_bounds  (  double *  coords  ) 
Returns the lower coordinates of the mesh's bounding box.
[in]  coords  A buffer for the returned coordinates 
int axom::quest::inout_mesh_max_bounds  (  double *  coords  ) 
Returns the upper coordinates of the mesh's bounding box.
[in]  coords  A buffer for the returned coordinates 
int axom::quest::inout_mesh_center_of_mass  (  double *  coords  ) 
Returns the center of mass of the mesh.
The function computes a discrete center of mass defined by the average of the mesh coordinates rather than a continuous center of mass defined by the mesh faces.
[in]  coords  A buffer for the returned coordinates 
int axom::quest::inout_get_dimension  (  ) 
Gets the spatial dimension of the query.
int axom::quest::inout_set_verbose  (  bool  verbosity  ) 
Enables/disables verbose logging output.
By default, the logging verbosity is set to false.
verbosity  True for more verbose, false for less verbose 
int axom::quest::inout_set_vertex_weld_threshold  (  double  thresh  ) 
Sets the cutoff distance for welding vertices during initialization.
By default, the welding threshold is 1E9.
The inout query requires the input surface to be watertight so this parameter should be set with care. A welding threshold that is too high could unnecessarily merge vertices and create topological defects, while a value that is too low risks leaving gaps in meshes with tolerances between vertices. The default value tends to work well in practice.
thresh  Cutoff distance for welding vertices 
int axom::quest::signed_distance_init  (  const std::string &  file, 
MPI_Comm  comm = MPI_COMM_SELF 

) 
Initializes the Signed Distance Query with a surface given in an STL formatted file.
[in]  file  the name of the file consisting of the surface mesh. 
[in]  comm  the MPI communicator (applicable when MPI is available) 
int axom::quest::signed_distance_init  (  const mint::Mesh *  m, 
MPI_Comm  comm = MPI_COMM_SELF 

) 
Initializes the Signed Distance Query with the given surface mesh.
[in]  m  pointer to the surface mesh object 
[in]  comm  the MPI communicator (applicable whem MPI is available) 
bool axom::quest::signed_distance_initialized  (  ) 
Checks if the Signed Distance Query has been initialized.
void axom::quest::signed_distance_set_dimension  (  int  dim  ) 
Sets the dimension for the Signed Distance Query.
[in]  dim  the dimension, e.g., 2 or 3 
void axom::quest::signed_distance_set_closed_surface  (  bool  status  ) 
Indicates whether the input to the signed distance consists of a watertight surface mesh, or not.
[in]  status  flag indicating whether the input is watertight 
void axom::quest::signed_distance_set_compute_signs  (  bool  computeSign  ) 
Sets whether the distance query should compute or ignore the sign.
[in]  computeSign  predicate indicating if sign should be computed 
void axom::quest::signed_distance_set_max_levels  (  int  maxLevels  ) 
Sets the maximum levels of subdivision for the BVH decomposition.
[in]  maxLevels  the maximum levels of subdivision. 
void axom::quest::signed_distance_set_max_occupancy  (  int  threshold  ) 
Sets threshold on the max number of items per BVH bin. This option controls the BVH decomposition.
[in]  threshold  max number of items per bin. 
void axom::quest::signed_distance_set_verbose  (  bool  status  ) 
Enables/Disables verbose output for the Signed Distance Query.
[in]  status  flag indicating whether to enable/disable verbose output 
void axom::quest::signed_distance_use_shared_memory  (  bool  status  ) 
Enable/Disable the use of MPI3 onnode shared memory for storing the surface mesh. By default this option is disabled.
[in]  status  flag indicating whether to enable/disable shared memory. 
double axom::quest::signed_distance_evaluate  (  double  x, 
double  y,  
double  z = 0.0 

) 
Evaluates the signed distance function at the given point.
[in]  x  the xcoordinate of the point in query 
[in]  y  the ycoordinate of the point in query 
[in]  z  the zcoordinate of the point in query 
void axom::quest::signed_distance_evaluate  (  const double *  x, 
const double *  y,  
const double *  z,  
int  npoints,  
double *  phi  
) 
Evaluates the signed distance function at the given set of points.
[in]  x  array consisting of the xcoordinates for each query point 
[in]  y  array consisting of the ycoordinates for each query point 
[in]  z  array consisting of the zcoordinates for each query point 
[in]  npoints  the number of query point 
[out]  phi  output array storing the signed distance of each point 
void axom::quest::signed_distance_get_mesh_bounds  (  double *  lo, 
double *  hi  
) 
Computes the bounds of the specified input mesh supplied to the Signed Distance Query.
[out]  lo  buffer to store the lower bound mesh coordinates. 
[out]  hi  buffer to store the upper bound mesh coordinates. 
void axom::quest::signed_distance_finalize  (  ) 
Finalizes the SignedDistance query.
constexpr int axom::quest::QUEST_INOUT_SUCCESS = 0 
constexpr int axom::quest::QUEST_INOUT_FAILED = 1 