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

Move iso7 to C++ #303

Merged
merged 84 commits into from
Apr 15, 2020
Merged

Move iso7 to C++ #303

merged 84 commits into from
Apr 15, 2020

Conversation

dwillcox
Copy link
Member

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 the esumN 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 and eos_type as well as aion, aion_inv, and zion still use 0-based indexing. The C++ iso7 liberally uses amrex::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.

dwillcox added 30 commits April 13, 2020 21:20
using namespace Rates;

{
Array1D<Real, 1, 8> b;
Copy link
Member

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.

Copy link
Member Author

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

@zingale zingale merged commit 2686629 into development Apr 15, 2020
Copy link
Member

@maxpkatz maxpkatz left a comment

Choose a reason for hiding this comment

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

Approved

@dwillcox dwillcox mentioned this pull request Apr 16, 2020
maxpkatz pushed a commit that referenced this pull request Apr 17, 2020
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.
@zingale zingale deleted the iso7-cpp branch August 6, 2020 13:32
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.

3 participants