-
Notifications
You must be signed in to change notification settings - Fork 26
Allowing XS plotting module to handle excitation reactions #305
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
Open
eitan-weinstein
wants to merge
7
commits into
svalinn:main
Choose a base branch
from
eitan-weinstein:handling_isomers_in_plotting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5104bc9
Adding '*' values to flagged_num_to_int() return
a790d3e
Fixing plotting module to handle excitation/arbitrary reactions
2bde4c5
Migrating multiplicity calculations to OpenMC dependency.
25127b6
Removing outdated endf_parserpy usage.
d2be63e
Undoing outdated changes to tendl_processing
da6280f
Streamlining null continuous_dict assignment.
cc005cd
Vectorizing pathways, parsing DSV with pandas
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| ! =========================== | ||
| ! This lightweight NJOY wrapper accesses the NJOY ENDF module's utility | ||
| ! function endf.terpa() to make use of NJOY's built-in interpolation | ||
| ! functionality to apply the appropriate interpolation schemes. The | ||
| ! designation for these schemes are encoded within the TAB1 record header | ||
| ! variable INT, representing one of the following interpolation schemes, as | ||
| ! laid out in the ENDF-6 manual | ||
| ! (https://www.nndc.bnl.gov/endfdocs/ENDF-102-2023.pdf), under section 0.5.2 | ||
| ! ("Interpolation Laws"): | ||
| ! | ||
| ! INT | Interpolation Scheme | ||
| ! 1 | y is constant in x (constant, histogram) | ||
| ! 2 | y is linear in x (linear-linear) | ||
| ! 3 | y is linear in ln(x) (linear-log) | ||
| ! 4 | ln(y) is linear in x (log-linear) | ||
| ! 5 | ln(y) is linear in ln(x) (log-log) | ||
| ! 6 | special one-dimensional interpolation law, used for charged- | ||
| ! | particle cross sections only | ||
| ! 11-25 | method of corresponding points (follow interpolation laws 1-5) | ||
| ! 21-25 | unit base interpolation (follow interpolation laws of 1-5) | ||
| ! | ||
| ! This module's incorporation and usage within ALARAJOYWrapper is managed by | ||
| ! njoy_tools.import_njoy_endf_wrapper(), which conditionally compiles this | ||
| ! Fortran file to an executable using numpy.f2py (if such an executable has | ||
| ! not already been created) and importing njoy_endf_wrapper as a Python | ||
| ! package. This allows the subroutine interpolate_tab1() to be callable within | ||
| ! ALARAJOYWrapper, which is necessary for the construction of pathway-specific | ||
| ! reaction cross-section from MF9 multiplicities multiplied by MF3 cumulative | ||
| ! cross-sections (see xs_plotting.extract_continuous_data() for specific use- | ||
| ! case implementation). | ||
| ! =========================== | ||
|
|
||
| module njoy_endf_wrapper | ||
|
|
||
| use endf | ||
| implicit none | ||
|
|
||
| contains | ||
|
|
||
| subroutine interpolate_tab1(tab1, x, y) | ||
|
|
||
| real(kind=8), intent(in) :: tab1(:) | ||
| real(kind=8), intent(in) :: x(:) | ||
| real(kind=8), intent(out) :: y(size(x)) | ||
|
|
||
| integer :: i | ||
| integer :: ip, ir, idis | ||
| real(kind=8) :: xnext | ||
|
|
||
| ip = 2 | ||
| ir = 1 | ||
|
|
||
| do i = 1, size(x) | ||
| call terpa(y(i), x(i), xnext, idis, tab1, ip, ir) | ||
| end do | ||
|
|
||
| end subroutine interpolate_tab1 | ||
|
|
||
| end module njoy_endf_wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has no-one written a python version of this yet??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I think it would be simple to write a python version for TAB1 interpolation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like I may actually be able to utilize
openmc.datato accomplish this, so long as we're fine further depending on OpenMCUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a follow up, I know that I just migrated everything to
endf_parserpy(though that was not so onerous), but now I wonder whether all of our ENDF interfacing could just be done through OpenMC anyways. I'm not sure if OpenMC's ENDF capabilities include the ability to parse PENDF files, though, so that could be the limiting factor for total migration.Either way, for the specific application of the continuous-energy parsing needed for this PR, I think OpenMC should be able to accomplish what we need.