Skip to content

Conversation

@paulromano
Copy link
Contributor

Description

This PR adds an optional bounding_boxes flag to the mesh material volume calculation so that each (mesh element, material) pair can also return an axis‑aligned bounding box. The primary implementation lives in Mesh::material_volumes; it uses low‑level atomic compare‑exchange intrinsics to achieve thread‑safe min/max updates for bounding box expansion. In the future, when we are able to utilize newer features in OpenMP 5, a lot of the ugly atomic-related code can be significantly simplified.

The main motivation for this feature is representing the decay photon source in mesh‑based R2S calculations. At present, R2SManager uses a MeshSource plus a domain constraint for each element‑material pair, which can be extremely inefficient when a material occupies only a tiny portion of an element. With bounding boxes available, the updated workflow here is to forgo MeshSource and instead build a Box source per element‑material combination, using the computed bounding box to restrict sampling while still applying the material domain constraint.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant