|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Namespaces | |
| detail | |
| experimental | |
| internal | |
Classes | |
| class | Delaunay |
| A class for incremental generation of a 2D or 3D Delaunay triangulation. More... | |
| class | DiscreteShape |
| Post-processed klee::Shape, with the geometry discretized and transformed according to the Shape's operators. More... | |
| class | DistributedClosestPoint |
| Encapsulated the Distributed closest point query for a collection of query points over an "object mesh". More... | |
| class | GWNMomentData |
| class | NURBSCurveGWNQuery |
| Preprocesses NURBSCurve geometry for GWN evaluation, and performs the calculation on the DOFs of an input MFEM mesh. More... | |
| class | PolylineGWNQuery |
| Preprocesses a linear mesh for GWN evaluation, and performs the calculation on the DOFs of an input MFEM mesh. More... | |
| class | NURBSPatchGWNQuery |
| Preprocesses NURBSPatch geometry for GWN evaluation, and performs the calculation on the DOFs of an input MFEM mesh. More... | |
| class | TriangleGWNQuery |
| Preprocesses a triangle mesh for GWN evaluation, and performs the calculation on the DOFs of an input MFEM mesh. More... | |
| struct | gwn_input_traits |
| struct | gwn_input_traits< axom::quest::PolylineGWNQuery< ExecSpace, ORDER > > |
| struct | gwn_input_traits< axom::quest::NURBSCurveGWNQuery< ExecSpace, ORDER > > |
| struct | gwn_input_traits< axom::quest::TriangleGWNQuery< ExecSpace, ORDER > > |
| struct | gwn_input_traits< axom::quest::NURBSPatchGWNQuery< ExecSpace, ORDER > > |
| struct | FieldStats |
| struct | IntegralStats |
| class | InOutOctree |
| class | TempArrayView |
| Provides a view over an MFEM grid function. MFEM grid functions are assumed to live in host memory. This class performs data movement needed to access the grid function data within a GPU device lambda. This view is limited in scope, though could be expanded in the future. More... | |
| class | IntersectionShaper |
| class | LinearizeCurves |
| This class linearizes a vector of NURBSCurve objects into line segments stored in a mint mesh. More... | |
| class | PointInCellTraits |
| A traits class for the mesh associated with a PointInCell query. More... | |
| class | PointInCell |
| A class to accelerate Point-In-Cell queries on a computational mesh. More... | |
| class | SamplingShaper |
| Concrete class for sample based shaping. More... | |
| class | ScatteredInterpolation |
| A class to perform scattered data interpolation at arbitrary points over an input point set. More... | |
| class | Shaper |
| class | SignedDistance |
Enumerations | |
| enum | SearchStatus { NEIGHBOR_NOT_FOUND = -1 } |
| enum class | GWNInputType { Curve , Polyline , Surface , Triangulation } |
| enum class | WatertightStatus : signed char { WATERTIGHT = 0 , NOT_WATERTIGHT , CHECK_FAILED } |
| enum class | SignedDistExec { CPU = 0 , OpenMP = 1 , GPU = 2 } |
Functions | |
| template<typename T , int NDIMS, int ORD, typename LeafGeometry , typename TraverserType > | |
| double | fast_approximate_winding_number (const primal::Point< T, NDIMS > &query, const TraverserType &traverser, const ArrayView< LeafGeometry > &leaf_objects, const ArrayView< GWNMomentData< T, NDIMS, ORD >> &internal_moments, const primal::WindingTolerances &wt, double beta=2.0) |
Evaluate a hierarchical approximation of the GWN for the shape in leaf_objects, encompassed by traverser's BVH. More... | |
| template<typename T > | |
| axom::Array< primal::NURBSCurve< T, 2 > > | subdivide_curves (const axom::ArrayView< const primal::NURBSCurve< T, 2 >> &input_curves_view, double bbox_threshold, int max_curves=1e6, int npasses=10) |
| Subdivides an array of NURBS curves to limit their maximum AABB diagonal. More... | |
| template<typename T > | |
| axom::Array< primal::NURBSPatch< T, 3 > > | subdivide_patches (const axom::ArrayView< const primal::NURBSPatch< T, 3 >> &input_patches_view, double bbox_threshold, int max_patches=1e5, int npasses=10) |
| Subdivides an array of trimmed NURBS surfaces to limit their maximum AABB diagonal. More... | |
| void | setup_gwn_mesh (mfem::DataCollection &dc, mfem::Mesh *query_mesh, int queryOrder) |
| template<int NDIMS> | |
| void | generate_gwn_query_mesh (mfem::DataCollection &dc, const axom::primal::BoundingBox< double, NDIMS > &shape_bbox, const std::vector< double > &boxMins, const std::vector< double > &boxMaxs, const std::vector< int > &boxResolution, int queryOrder) |
| FieldStats | compute_field_stats (const mfem::GridFunction &gf) |
| IntegralStats | compute_integrals (const mfem::GridFunction &gf) |
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... | |
Visualize octahedra as tet mesh | |
| int | mesh_from_discretized_polyline (const axom::ArrayView< OctType > &octs, int octcount, int segcount, mint::Mesh *&mesh) |
| Produces a mesh of tets from an array of Octahedra. More... | |
Mesh test and repair | |
| template<typename ExecSpace , typename FloatType > | |
| void | findTriMeshIntersectionsBVH (mint::UnstructuredMesh< mint::SINGLE_SHAPE > *surface_mesh, std::vector< std::pair< int, int >> &intersections, std::vector< int > °enerateIndices, double intersectionThreshold=1E-8) |
| Find self-intersections and degenerate triangles in a surface mesh utilizing a Bounding Volume Hierarchy. More... | |
| template<typename ExecSpace , typename FloatType > | |
| void | findTriMeshIntersectionsImplicitGrid (mint::UnstructuredMesh< mint::SINGLE_SHAPE > *surface_mesh, std::vector< std::pair< int, int >> &intersections, std::vector< int > °enerateIndices, int spatialIndexResolution=0, double intersectionThreshold=1E-8) |
| Find self-intersections and degenerate triangles in a surface mesh utilizing an implicit grid spatial index. More... | |
| template<typename ExecSpace , typename FloatType > | |
| void | findTriMeshIntersectionsUniformGrid (mint::UnstructuredMesh< mint::SINGLE_SHAPE > *surface_mesh, std::vector< std::pair< int, int >> &intersections, std::vector< int > °enerateIndices, int spatialIndexResolution=0, double intersectionThreshold=1E-8) |
| Find self-intersections and degenerate triangles in a surface mesh utilizing an uniform grid spatial index. More... | |
| 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=1E-8) |
| Find self-intersections and degenerate triangles in a surface mesh utilizing a Uniform Grid. 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 (std::shared_ptr< mint::Mesh > &mesh, MPI_Comm comm=MPI_COMM_SELF) |
| Initialize the inout query using a pre-loaded 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_dimension (int dim) |
| Sets the spatial dimension of the query. More... | |
| 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... | |
| int | inout_set_segments_per_knot_span (int segmentsPerKnotSpan) |
| Sets the number of samples for each knot span (2D only) 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 water-tight 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_allocator (int allocatorID) |
| Sets the allocator to use for creating internal signed distance query data structures. 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 on-node shared memory (via Umpire's shared-memory resource) for storing the surface mesh. By default this option is disabled. More... | |
| void | signed_distance_set_shared_memory_size (std::size_t min_segment_size) |
| Set the minimum size (in bytes) of the backing shared-memory segment used to store the surface mesh when signed_distance_use_shared_memory(true) is enabled. More... | |
| void | signed_distance_set_execution_space (SignedDistExec execSpace) |
| Set the execution space in which to run signed distance queries. By default this option is set to SIGNED_DIST_EVAL_CPU. 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... | |
| double | signed_distance_evaluate (double x, double y, double z, double &cp_x, double &cp_y, double &cp_z, double &n_x, double &n_y, double &n_z) |
| Evaluates the signed distance function at the given 3D 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 | |
| template<typename GWNQueryType > | |
| constexpr GWNInputType | gwn_input_type_v = gwn_input_traits<GWNQueryType>::value |
| constexpr int | QUEST_INOUT_SUCCESS = 0 |
| constexpr int | QUEST_INOUT_FAILED = -1 |
Discretize primitive shapes to linear shapes | |
| using | SphereType = primal::Sphere< double, 3 > |
| using | OctType = primal::Octahedron< double, 3 > |
| using | Point2D = primal::Point< double, 2 > |
| bool | discretize (const SphereType &s, int levels, axom::Array< OctType > &out, int &octcount) |
| Given a primitive sphere and a refinement level, allocate and return a list of Octahedra approximating the shape. More... | |
| template<typename ExecSpace > | |
| bool | discretize (const axom::ArrayView< Point2D > &polyline, int len, int levels, axom::Array< OctType > &out, int &octcount) |
| Given a 2D polyline revolved around the positive X-axis, allocate and return a list of Octahedra approximating the shape. More... | |
| using axom::quest::SphereType = typedef primal::Sphere<double, 3> |
| using axom::quest::OctType = typedef primal::Octahedron<double, 3> |
| using axom::quest::Point2D = typedef primal::Point<double, 2> |
|
strong |
|
strong |
|
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 | X-coordinates of input points |
| [in] | y | Y-coordinates of input points |
| [in] | z | Z-coordinates of input points |
| [in] | region | Region of each point |
| [in] | n | Number of points |
| [in] | limit | Max distance for all-nearest-neighbors 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 brute-force all-to-all algorithm, but the query's run time is dependent on the point distribution.
| bool axom::quest::discretize | ( | const SphereType & | s, |
| int | levels, | ||
| axom::Array< OctType > & | out, | ||
| int & | octcount | ||
| ) |
Given a primitive sphere and a refinement level, allocate and return a list of Octahedra approximating the shape.
| [in] | s | The sphere to approximate |
| [in] | levels | The number of refinements to perform, in addition to a central level-zero octahedron |
| [out] | out | The newly-initialized Array of octahedra representing s |
| [out] | octcount | The number of elements in out |
This routine generates O(4^level) octahedra. That's exponential growth. Use appropriate caution.
| bool axom::quest::discretize | ( | const axom::ArrayView< Point2D > & | polyline, |
| int | len, | ||
| int | levels, | ||
| axom::Array< OctType > & | out, | ||
| int & | octcount | ||
| ) |
Given a 2D polyline revolved around the positive X-axis, allocate and return a list of Octahedra approximating the shape.
| [in] | polyline | The polyline to revolve around the X-axis. Data should be in a host-accessible memory space. |
| [in] | len | The number of points in polyline |
| [in] | levels | The number of refinements to perform, in addition to a central level-zero octahedron in each segment |
| [out] | out | The newly-initialized Array of octahedra representing the revolved polyline |
| [out] | octcount | The number of elements in out |
This routine generates n*O(2^level) octahedra, where n is the number of segments in polyline (one less than the length). That's exponential growth. Use appropriate caution.
| int axom::quest::mesh_from_discretized_polyline | ( | const axom::ArrayView< OctType > & | octs, |
| int | octcount, | ||
| int | segcount, | ||
| mint::Mesh *& | mesh | ||
| ) |
Produces a mesh of tets from an array of Octahedra.
| [in] | octs | Array of Octahedron objects |
| [in] | octcount | Length of octs |
| [in] | segcount | Number of segments in the polyline originating the octs |
| [out] | mesh | Pointer to a mesh object where the mesh will be generated. |
This function creates a new Mint mesh out of an array of Octahedron objects. The mesh will be valid for any oct array, but the fields it includes make sense for the output of discretizing a revolved polyline:
| double axom::quest::fast_approximate_winding_number | ( | const primal::Point< T, NDIMS > & | query, |
| const TraverserType & | traverser, | ||
| const ArrayView< LeafGeometry > & | leaf_objects, | ||
| const ArrayView< GWNMomentData< T, NDIMS, ORD >> & | internal_moments, | ||
| const primal::WindingTolerances & | wt, | ||
| double | beta = 2.0 |
||
| ) |
Evaluate a hierarchical approximation of the GWN for the shape in leaf_objects, encompassed by traverser's BVH.
Traverse the BVH at the input query. For any node which is considered "far-away", approximate the GWN for that node For any node which is a leaf (i.e. close to the query), compute the GWN directly
| T | Numeric type of geometric primitives |
| NDIMS | The spatial dimensions of the shape (2 or 3) |
| ORD | The number of terms in the Taylor expansion |
| LeafGeometry | The type of the objects which could require direct evaluation |
| TraverserType | The derived type of the traverser for the BVH tree |
| [in] | query | The query point at which to evaluate the GWN |
| [in] | traverser | A traverser for the BVH tree |
| [in] | leaf_objects | A view of all individual geometric objects in the shape, indexed by position in the BVH tree |
| [in] | internal_moments | A view of GWNMomentData objects for each internal node of the BVH tree, each representing a cluster of leaf objects |
| [in] | wt | A structure of possible tolerances for GWN evaluation to permit flexible evaluation for many different type of leaf objects |
| [in] | beta | An "accuracy parameter" which scales at what distance from an AABB a query point is considered to be "far-away". |
The default parameter beta = 2.0 is suggested by the work "Fast Winding Numbers for Soups and Clouds" by Barill et al. (2018)
References axom::primal::WindingTolerances::disk_size, axom::primal::WindingTolerances::edge_tol, axom::primal::WindingTolerances::EPS, axom::primal::WindingTolerances::ls_tol, axom::primal::WindingTolerances::quad_tol, axom::primal::squared_distance(), and axom::primal::winding_number().
| axom::Array<primal::NURBSCurve<T, 2> > axom::quest::subdivide_curves | ( | const axom::ArrayView< const primal::NURBSCurve< T, 2 >> & | input_curves_view, |
| double | bbox_threshold, | ||
| int | max_curves = 1e6, |
||
| int | npasses = 10 |
||
| ) |
Subdivides an array of NURBS curves to limit their maximum AABB diagonal.
| [in] | input_curves_view | A const view to the const NURBS input curves |
| [in] | bbox_threshold | The maximum AABB diagonal of each subdivided curve, as a percent of an AABB of the entire input shape |
| [in] | max_curves | The maximum number of curves after which further curves will not be subdivided |
| [in] | npasses | The maximum number of passes through the input curves before an early return |
Starts with a collection of Bezier-extracted components, then iterates through the curves at most npasses times, and subdivides any which have an AABB diagonal greater than the threshold. The AABB of the entire shape is based on the union of AABB for the subdivisions, which is tighter than that of the original
References axom::Array< T, DIM, SPACE, StoragePolicy >::back(), axom::Array< T, DIM, SPACE, StoragePolicy >::clear(), axom::Array< T, DIM, SPACE, StoragePolicy >::emplace_back(), axom::Array< T, DIM, SPACE, StoragePolicy >::push_back(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), SLIC_WARNING, SLIC_WARNING_IF, and axom::Array< T, DIM, SPACE, StoragePolicy >::swap().
| axom::Array<primal::NURBSPatch<T, 3> > axom::quest::subdivide_patches | ( | const axom::ArrayView< const primal::NURBSPatch< T, 3 >> & | input_patches_view, |
| double | bbox_threshold, | ||
| int | max_patches = 1e5, |
||
| int | npasses = 10 |
||
| ) |
Subdivides an array of trimmed NURBS surfaces to limit their maximum AABB diagonal.
| [in] | input_patches_view | A const view to the const NURBS input surfaces |
| [in] | bbox_threshold | The maximum AABB diagonal of each subdivided surface, as a percent of an AABB of the entire input shape |
| [in] | max_patches | The maximum number of surfaces before additional surfaces will not be subdivided |
| [in] | npasses | The maximum number of passes through the input surfaces before an early return |
Iterates through the curves at most npasses times, and subdivides any which have an AABB diagonal greater than the threshold. The AABB of the entire shape is based on the union of AABB for the subdivisions, which is tighter than that of the original Subdivision is performed on the single axis which is determined to be "longer" in physical space, as determined by NURBSPatch::nearBisectOnLongerAxis
References axom::Array< T, DIM, SPACE, StoragePolicy >::back(), axom::Array< T, DIM, SPACE, StoragePolicy >::clear(), axom::Array< T, DIM, SPACE, StoragePolicy >::emplace_back(), axom::Array< T, DIM, SPACE, StoragePolicy >::push_back(), axom::Array< T, DIM, SPACE, StoragePolicy >::reserve(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), SLIC_WARNING, and axom::Array< T, DIM, SPACE, StoragePolicy >::swap().
| void axom::quest::setup_gwn_mesh | ( | mfem::DataCollection & | dc, |
| mfem::Mesh * | query_mesh, | ||
| int | queryOrder | ||
| ) |
Helper function to set up the mesh and associated winding and inout fields. Uses an mfem::DataCollection to hold everything together.
References AXOM_ANNOTATE_SCOPE.
| void axom::quest::generate_gwn_query_mesh | ( | mfem::DataCollection & | dc, |
| const axom::primal::BoundingBox< double, NDIMS > & | shape_bbox, | ||
| const std::vector< double > & | boxMins, | ||
| const std::vector< double > & | boxMaxs, | ||
| const std::vector< int > & | boxResolution, | ||
| int | queryOrder | ||
| ) |
Query grid setup; has some dimension-specific types; if user did not provide a bounding box, use shape bounding box scaled by 10%
References AXOM_ANNOTATE_SCOPE, axom::primal::BoundingBox< T, NDIMS >::getMax(), axom::primal::BoundingBox< T, NDIMS >::getMin(), setup_gwn_mesh(), and SLIC_INFO.
| FieldStats axom::quest::compute_field_stats | ( | const mfem::GridFunction & | gf | ) |
References axom::quest::FieldStats::dof_l2, and axom::utilities::max().
| IntegralStats axom::quest::compute_integrals | ( | const mfem::GridFunction & | gf | ) |
| void axom::quest::findTriMeshIntersectionsBVH | ( | mint::UnstructuredMesh< mint::SINGLE_SHAPE > * | surface_mesh, |
| std::vector< std::pair< int, int >> & | intersections, | ||
| std::vector< int > & | degenerateIndices, | ||
| double | intersectionThreshold = 1E-8 |
||
| ) |
Find self-intersections 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: 1E-8) 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. |
References AXOM_ANNOTATE_SCOPE, axom::Array< T, DIM, SPACE, StoragePolicy >::begin(), axom::Array< T, DIM, SPACE, StoragePolicy >::end(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and SLIC_INFO.
| void axom::quest::findTriMeshIntersectionsImplicitGrid | ( | mint::UnstructuredMesh< mint::SINGLE_SHAPE > * | surface_mesh, |
| std::vector< std::pair< int, int >> & | intersections, | ||
| std::vector< int > & | degenerateIndices, | ||
| int | spatialIndexResolution = 0, |
||
| double | intersectionThreshold = 1E-8 |
||
| ) |
Find self-intersections and degenerate triangles in a surface mesh utilizing an implicit grid spatial index.
| [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: 1E-8) 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::ImplicitGrid 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.
References AXOM_ANNOTATE_SCOPE, axom::Array< T, DIM, SPACE, StoragePolicy >::begin(), axom::Array< T, DIM, SPACE, StoragePolicy >::end(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and SLIC_INFO.
| void axom::quest::findTriMeshIntersectionsUniformGrid | ( | mint::UnstructuredMesh< mint::SINGLE_SHAPE > * | surface_mesh, |
| std::vector< std::pair< int, int >> & | intersections, | ||
| std::vector< int > & | degenerateIndices, | ||
| int | spatialIndexResolution = 0, |
||
| double | intersectionThreshold = 1E-8 |
||
| ) |
Find self-intersections and degenerate triangles in a surface mesh utilizing an uniform grid spatial index.
| [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: 1E-8) 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.
References AXOM_ANNOTATE_SCOPE, axom::Array< T, DIM, SPACE, StoragePolicy >::begin(), axom::Array< T, DIM, SPACE, StoragePolicy >::end(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and SLIC_INFO.
| 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 = 1E-8 |
||
| ) |
Find self-intersections 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: 1E-8) |
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.
| 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 |
| 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.
| 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 | ( | std::shared_ptr< mint::Mesh > & | mesh, |
| MPI_Comm | comm = MPI_COMM_SELF |
||
| ) |
Initialize the inout query using a pre-loaded 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 x-coordinate of the query point |
| [in] | y | The y-coordinate of the query point |
| [in] | z | The z-coordinate 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 x-coordinates for the query points |
| [in] | y | Array of y-coordinates for the query points |
| [in] | z | Array of z-coordinates 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_dimension | ( | int | dim | ) |
Sets the spatial dimension of the query.
| dim | The dimension for the inout 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 1E-9.
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::inout_set_segments_per_knot_span | ( | int | segmentsPerKnotSpan | ) |
Sets the number of samples for each knot span (2D only)
By default, the welding threshold is 25
Span intervals are the segments of each curve. This parameter controls the number of samples to use when linearizing each knot span of the contour splines
| segmentsPerKnotSpan | The number of segments for each knot span |
| 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 water-tight surface mesh, or not.
| [in] | status | flag indicating whether the input is water-tight |
| 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_allocator | ( | int | allocatorID | ) |
Sets the allocator to use for creating internal signed distance query data structures.
| [in] | allocatorID | the allocator ID to use |
| 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 on-node shared memory (via Umpire's shared-memory resource) for storing the surface mesh. By default this option is disabled.
| [in] | status | flag indicating whether to enable/disable shared memory. |
| void axom::quest::signed_distance_set_shared_memory_size | ( | std::size_t | min_segment_size | ) |
Set the minimum size (in bytes) of the backing shared-memory segment used to store the surface mesh when signed_distance_use_shared_memory(true) is enabled.
| [in] | min_segment_size | Minimum desired shared-memory segment size in bytes (0 to use defaults). This value is treated as a minimum; the implementation may choose a larger value to accommodate the mesh buffer (plus some overhead). |
| void axom::quest::signed_distance_set_execution_space | ( | SignedDistExec | execSpace | ) |
Set the execution space in which to run signed distance queries. By default this option is set to SIGNED_DIST_EVAL_CPU.
| [in] | exec_space | the execution space setting, one of the enum values in SignedDistExec. |
| 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 x-coordinate of the point in query |
| [in] | y | the y-coordinate of the point in query |
| [in] | z | the z-coordinate of the point in query |
| double axom::quest::signed_distance_evaluate | ( | double | x, |
| double | y, | ||
| double | z, | ||
| double & | cp_x, | ||
| double & | cp_y, | ||
| double & | cp_z, | ||
| double & | n_x, | ||
| double & | n_y, | ||
| double & | n_z | ||
| ) |
Evaluates the signed distance function at the given 3D point.
| [in] | x | the x-coordinate of the point in query |
| [in] | y | the y-coordinate of the point in query |
| [in] | z | the z-coordinate of the point in query |
| [out] | cp_x | the x-coordinate of the computed closest point on surface to query point |
| [out] | cp_y | the y-coordinate of the computed closest point on surface to query point |
| [out] | cp_z | the z-coordinate of the computed closest point on surface to query point |
| [out] | n_x | the x-coordinate of the surface normal at the computed closest point |
| [out] | n_y | the y-coordinate of the surface normal at the computed closest point |
| [out] | n_z | the z-coordinate of the surface normal at the computed closest point |
| 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 x-coordinates for each query point |
| [in] | y | array consisting of the y-coordinates for each query point |
| [in] | z | array consisting of the z-coordinates 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.
|
inlineconstexpr |
|
constexpr |
|
constexpr |