Skip to content

Conversation

@nuclearkevin
Copy link
Contributor

@nuclearkevin nuclearkevin commented Jan 23, 2026

Description

This brief PR adds the random ray run function to the C-API, with inclusions in the openmc.lib Python bindings. This provides a frontend for wrapper applications which want to expose the random ray solver for multiphysics.

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)

@jtramm
Copy link
Contributor

jtramm commented Jan 23, 2026

Do we currently have a way in the CI to test the C-API calls? I'm guessing not, but if we happen to already be testing other portions of the C-API, then might as well here, too.

@nuclearkevin
Copy link
Contributor Author

In this case the C-API functions are getting implicitly hit by all of the random ray tests, as the C-API functions are used when resetting and running the random ray solver in OpenMC proper. I can definitely add a test for openmc.lib additions though

- This is handled in openmc_finalize
- Also rename openmc_reset_random_ray to openmc_finalize_random_ray (more clear IMO)
@nuclearkevin
Copy link
Contributor Author

nuclearkevin commented Jan 24, 2026

Added a test for openmc_run_random_ray(). I also elected to remove the openmc_reset_random_ray() function from the C-API / Python bindings as it's called in openmc_finalize().

Additionally, I renamed openmc_reset_random_ray() to openmc_finalize_random_ray() to account for the fact that the data structures cleared cannot be repopulated without re-initializing the simulation (from XML files).

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