Skip to content

Overlap detection for plotter#3969

Open
viktormai wants to merge 26 commits into
openmc-dev:developfrom
viktormai:overlap-detection-for-plotter
Open

Overlap detection for plotter#3969
viktormai wants to merge 26 commits into
openmc-dev:developfrom
viktormai:overlap-detection-for-plotter

Conversation

@viktormai

Copy link
Copy Markdown

Description

This PR adds overlap detection support to the slice data API, enabling
the OpenMC plotter to identify and display which specific cells are
overlapping at a given pixel.

Changes

  • Modified check_cell_overlap to return an OverlapResult struct instead
    of a simple boolean, containing a list of OverlapKey pairs (cell1_id,
    cell2_id, universe_id) for each detected overlap
  • Added pixel_overlaps_ field to RasterData to store per-pixel overlap
    pair data during raster plot generation
  • Added openmc_slice_data_overlap_count C API function to query the number
    of overlapping cell pairs at a given pixel
  • Added openmc_slice_data_overlap_info C API function to retrieve the
    overlapping cell IDs and universe ID at a given pixel
  • Added corresponding Python bindings in openmc/lib/plot.py

Previously the plotter could color overlap pixels but had no way to tell
the user which cells were overlapping. This change stores the overlap
pair data during plot generation so the plotter can display meaningful
overlap information when a user hovers over an overlap pixel.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 18) 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)

@viktormai viktormai requested a review from pshriwise as a code owner June 10, 2026 22:52
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.

2 participants