-
Notifications
You must be signed in to change notification settings - Fork 35
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
Move iso7 to C++ #303
Move iso7 to C++ #303
Conversation
…tors after calling screening_init()...
…and introduce some math.
…yNDs into ArrayUtil::RealArrayND.
networks/iso7/actual_rhs.H
Outdated
using namespace Rates; | ||
|
||
{ | ||
Array1D<Real, 1, 8> b; |
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.
In the Fortran what we were doing here is reusing the same array and relying on the fact that esumN ever uses more than N elements of the array. I don't have any problem with this way of writing it, as long as the compiler figures out that it can reuse the registers under the hood.
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.
yes, hopefully so with the {} scoping
it's easy enough to make the esums take arbitrary sized Array1Ds if we need
this will be used if compiling with `USE_NETWORK_SOLVER=TRUE`
…etwork_properties header
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.
Approved
This PR ports aprox13 to C++ using the same strategy as for iso7 in #303. This PR also adds input files for test_rhs for aprox13 based on test_react inputs, except with call_eos_in_rhs=T. To avoid completely refactoring the rhs in aprox13, passing arbitrary size Array1D arrays to all esum functions is now enabled by making esums templated functions.
This PR moves the iso7 network to C++ as well as other parts of Microphysics the network depends on.
This includes a C++ version of
sneut5
as well as theesumN
code generator script.A test is added in
unit_test/test_rhs
that calls the RHS and Jacobian for a network and saves the output into a plotfile using either the C++ or Fortran network to make comparisons easy.Attached is the fcompare for the RHS and Jacobian for iso7 using the same thermodynamic ranges as inputs as for the
test_react
unit test.fc.txt
This PR also rearranges the screening API a bit to require zion and aion for all screened nuclei for convenience.
Right now the interfaces like
burn_type
andeos_type
as well asaion
,aion_inv
, andzion
still use 0-based indexing. The C++ iso7 liberally usesamrex::Array1D
with 1-based indexing to make comparisons & porting from Fortran much easier.In the future we can standardize this, but that's probably best saved for another PR.