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

Correctness of primal::intersection_volume(Hexahedron, Tetrahedron) for general hexahedra #1396

Open
kennyweiss opened this issue Aug 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working Documentation Issues related to documentation Primal Issues related to Axom's 'primal component Reviewed

Comments

@kennyweiss
Copy link
Member

kennyweiss commented Aug 12, 2024

The current implementation of primal::intersection_volume(Hexahedron, Tetrahedron) uses primal::clip(Hexahedron, Tetrahedron), which in turn uses primal::Polyhedron::from_primitive(Hexahedron).

However, since our Polyhedron class assumes planar faces, primal::Polyhedron::from_primitive(Hexahedron) is not valid for hexahedra with non-planar faces. Since our Hexahedron class is initialized with 8 unconstrained vertices, the faces of a (valid) Hexahedron will be bilinear rather than planar.

To remedy this:

  • We should add a function to Hexahedron to check if its faces are (nearly) planar
  • Polyhedron::from_primitive(Hexahedron) should only operate on Hexahedra with planar faces. This should either be explicitly checked at runtime, or in debug mode (via SLIC_DEBUG). At the very least, we should document this
  • Similarly, primal::clip(Hexahedron, Tetrahedron) is only applicable to planar Hexahedra. We should add this to the docs, and consider adding runtime/debug checks, as appropriate
  • primal::intersection_volume(Hexahedron, Tetrahedron) should be updated to split Hexahedra into 24 tets and return the sum of the volumes of their intersections. When the input Hexahedron has planar faces, we can use the current clip algorithm.
    • We'll likely want to benchmark whether the checks for planar faces + clip is more performant than the "sum of intersections" algorithm and use the more performant one
  • We'll also need to update the tests for intersection_volume(Hex, Tet) to ensure we have cases with non-planar hexahedra.
@kennyweiss kennyweiss added bug Something isn't working Primal Issues related to Axom's 'primal component Documentation Issues related to documentation labels Aug 12, 2024
@bmhan12 bmhan12 self-assigned this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Documentation Issues related to documentation Primal Issues related to Axom's 'primal component Reviewed
Projects
None yet
Development

No branches or pull requests

3 participants