-
Notifications
You must be signed in to change notification settings - Fork 189
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
Implement reader for NuLib interaction tables #5902
Implement reader for NuLib interaction tables #5902
Conversation
4976990
to
eeeb5d9
Compare
b5f2c05
to
a20cef5
Compare
a20cef5
to
5752243
Compare
Rebased against develop. |
5752243
to
77f4faf
Compare
Added a second commit with a constructor for the interaction tables directly from vectors of interaction rates provided as input, instead of reading from a NuLib table. This allows for a simpler testing interface than having to generate fake tables. |
4b99218
to
c518ce6
Compare
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.
Looks great! I have a few minor suggestions. I think the biggest suggestion is using our existing multi-linear interpolation code. I think you can also squash the two commits into one :)
src/Evolution/Particles/MonteCarlo/NeutrinoInteractionTable.cpp
Outdated
Show resolved
Hide resolved
src/Evolution/Particles/MonteCarlo/NeutrinoInteractionTable.cpp
Outdated
Show resolved
Hide resolved
src/Evolution/Particles/MonteCarlo/NeutrinoInteractionTable.cpp
Outdated
Show resolved
Hide resolved
src/Evolution/Particles/MonteCarlo/NeutrinoInteractionTable.cpp
Outdated
Show resolved
Hide resolved
src/Evolution/Particles/MonteCarlo/NeutrinoInteractionTable.cpp
Outdated
Show resolved
Hide resolved
src/Evolution/Particles/MonteCarlo/NeutrinoInteractionTable.cpp
Outdated
Show resolved
Hide resolved
src/IO/H5/Helpers.cpp
Outdated
@@ -134,6 +169,8 @@ Matrix vector_to_matrix(const std::vector<double>& raw_data, | |||
} | |||
return temp; | |||
} | |||
|
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.
Remove added blank lines?
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.
Ping on removing this blank line
src/Evolution/Particles/MonteCarlo/NeutrinoInteractionTable.hpp
Outdated
Show resolved
Hide resolved
c518ce6
to
9237a26
Compare
Not ready for second review yet; I still have to deal with interpolation and moving the physical constants to the proper header. |
@nilsdeppe Updated the code to use the existing multiD linear interpolator. As this changes a lot of the code (though not in a particularly difficult way), I kept the change as a separate commit. We can merge both commits once you're happy with the new version. |
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.
LGTM! Just one small ping. Please go ahead and squash and rebase :)
src/IO/H5/Helpers.cpp
Outdated
@@ -134,6 +169,8 @@ Matrix vector_to_matrix(const std::vector<double>& raw_data, | |||
} | |||
return temp; | |||
} | |||
|
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.
Ping on removing this blank line
17d2d0a
to
d32f776
Compare
Removed blank line and squashed. |
number_of_vars; | ||
idx = 2 * (NeutrinoSpecies * EnergyBins) + idx_emissivity; | ||
table_data[idx] = buffer[ng][ns][ny][nt][nr] * length_unit; | ||
std::clamp(table_data[idx], min_kappa, max_kappa); |
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.
aha! The macos failure is saying this should be:
table_data[idx] = std::clamp(table_data[idx], min_kappa, max_kappa);
d32f776
to
77b61ee
Compare
Fixed |
Proposed changes
Base implementation of a reader for NuLib tables of neutrino-matter interactions.
Upgrade instructions
NA
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.