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

Allow MeshSource to take a 1D array of sources #2980

Merged
merged 1 commit into from May 3, 2024

Conversation

paulromano
Copy link
Contributor

Description

Right now, the MeshSource class requires that when you provide sources for each element of a structured mesh, you pass it a multidimensional array that has the same shape as the mesh. So, if you have a RegularMesh with mesh.dimension = (10, 2, 5), then the array of sources also has to be of shape (10, 2, 5). This PR allows you to pass a flat array of sources in the order of the mesh element indices. This makes it a more mesh agnostic since the same interface can be used for both structured and unstructured meshes (passing a flat array).

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)

Copy link
Contributor

@eepeterson eepeterson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @paulromano!

@eepeterson eepeterson merged commit cfe210d into openmc-dev:develop May 3, 2024
18 checks passed
@paulromano paulromano deleted the mesh-source-flat branch May 3, 2024 21:24
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.

None yet

2 participants