Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port vertex welding code to GPUs via RAJA #705

Open
kennyweiss opened this issue Nov 8, 2021 · 1 comment
Open

Port vertex welding code to GPUs via RAJA #705

kennyweiss opened this issue Nov 8, 2021 · 1 comment
Labels
enhancement New feature or request GPU Issues related to GPU development low priority Quest Issues related to Axom's 'quest' component Reviewed Spin Issues related to Axom's 'spin' component

Comments

@kennyweiss
Copy link
Member

The vertex welding code converts a "soup of triangles", e.g. from an STL mesh, into a mesh whose triangles share vertices.

The code currently depends on std library functionality, e.g. hashmaps (std::unordered_map) and std::hash,
as well as spin::RectangularLattice (which is being ported in #677). GPU-ready hashmaps are the subject of #630

/*!
* \brief Mesh repair function to weld vertices that are closer than \a eps
*
* \param [in,out] surface_mesh A pointer to a pointer to a triangle mesh
* \param [in] eps Distance threshold for welding vertices (using the max norm)
*
* \pre \a eps must be greater than zero
* \pre \a surface_mesh is a pointer to a pointer to a non-null triangle mesh.
* \post The triangles of \a surface_mesh are reindexed using the welded
* vertices and degenerate triangles are removed. The mesh can still contain
* vertices that are not referenced by any triangles.
*
* This utility function repairs an input triangle mesh (embedded in three
* dimensional space) by 'welding' vertices that are closer than \a eps.
* The vertices are quantized to an integer lattice with spacing \a 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 \a 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.
*
* \note This function is destructive. It modifies the input triangle
* mesh in place.
* \note The distance metric in this function uses the "max" norm (l_inf).
*/
void weldTriMeshVertices(mint::UnstructuredMesh<mint::SINGLE_SHAPE>** surface_mesh,
double eps);

This might be helpful for improved robustness in the SignedDistance query. See, e.g. #703.

@kennyweiss kennyweiss added enhancement New feature or request Quest Issues related to Axom's 'quest' component Spin Issues related to Axom's 'spin' component GPU Issues related to GPU development labels Nov 8, 2021
@kennyweiss kennyweiss added this to the FY22 Development milestone Nov 15, 2021
@kennyweiss kennyweiss modified the milestones: FY22 Development, FY23 Development Jan 17, 2023
@kennyweiss kennyweiss modified the milestones: FY23 Development, FY24 Development Oct 26, 2023
@rhornung67
Copy link
Member

Assign after GPU hashmap is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request GPU Issues related to GPU development low priority Quest Issues related to Axom's 'quest' component Reviewed Spin Issues related to Axom's 'spin' component
Projects
None yet
Development

No branches or pull requests

2 participants