Skip to content

Commit

Permalink
Merge branch 'development' into ROCK4
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Oct 3, 2023
2 parents 4657fe4 + e3e866c commit b3d7629
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 61 deletions.
1 change: 1 addition & 0 deletions .github/workflows/good_defines.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RATES
REACTIONS
SCREENING
SCREEN_METHOD
SDC
SIMPLIFIED_SDC
STRANG
TRUE_SDC
Expand Down
15 changes: 14 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 23.10

* The simplified-SDC and true-SDC code paths for integration
have been merged (#1338, #1340, #1341).

* All pynucastro networks have been updated with the latest
version of pynucastro (2.1.0) (#1342)

* The neutrino cooling terms now use templating on derivatives
(#1329)

* `NUM_EXTRA_SPECIES` was removed (#1321)

# 23.09

* The file NETWORK_PROPERTIES has been removed from each network,
Expand Down Expand Up @@ -349,7 +362,7 @@
# 20.08

* Several of the unit tests had separate C++ and Fortran
implementions. These have been unified (#343, #344, #345)
implementations. These have been unified (#343, #344, #345)

* The VBDF integrator was removed (#348)

Expand Down
7 changes: 7 additions & 0 deletions Make.Microphysics_extern
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# This is the main include makefile for applications that want to use Microphysics
# You should set NETWORK_OUTPUT_PATH before including this file

# for common code paths between simplified-SDC and true-SDC, we'll
# use the SDC define

ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
DEFINES += -DSIMPLIFIED_SDC
DEFINES += -DSDC
USE_ALL_SDC := TRUE
else ifeq ($(USE_TRUE_SDC), TRUE)
DEFINES += -DTRUE_SDC
DEFINES += -DSDC
USE_ALL_SDC := TRUE
else
DEFINES += -DSTRANG
endif
Expand Down
6 changes: 2 additions & 4 deletions integration/BackwardEuler/Make.package
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
ifeq ($(USE_ALL_SDC), TRUE)
CEXE_headers += actual_integrator_simplified_sdc.H
else
ifneq ($(USE_TRUE_SDC), TRUE)
CEXE_headers += actual_integrator.H
endif
CEXE_headers += actual_integrator.H
endif

CEXE_headers += be_integrator.H
Expand Down
4 changes: 2 additions & 2 deletions integration/BackwardEuler/be_integrator.H
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifdef STRANG
#include <integrator_rhs_strang.H>
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_rhs_simplified_sdc.H>
#endif
#include <integrator_data.H>
Expand Down Expand Up @@ -173,7 +173,7 @@ int be_integrator (BurnT& state, BeT& be)

be.n_rhs += 1;

Real dt_sub = initial_dt(state, be, ydot);
Real dt_sub = initial_react_dt(state, be, ydot);

// main timestepping loop

Expand Down
2 changes: 1 addition & 1 deletion integration/BackwardEuler/be_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifdef STRANG
#include <integrator_type_strang.H>
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_type_simplified_sdc.H>
#endif
#include <network.H>
Expand Down
14 changes: 5 additions & 9 deletions integration/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,19 @@ CEXE_headers += integrator.H
CEXE_headers += integrator_data.H
CEXE_headers += integrator_type.H

ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
ifeq ($(USE_ALL_SDC), TRUE)
CEXE_headers += integrator_rhs_simplified_sdc.H
CEXE_headers += integrator_type_simplified_sdc.H
else
ifneq ($(USE_TRUE_SDC), TRUE)
CEXE_headers += integrator_type_strang.H
CEXE_headers += integrator_rhs_strang.H
endif
CEXE_headers += integrator_type_strang.H
CEXE_headers += integrator_rhs_strang.H
endif

ifeq ($(USE_NSE_TABLE), TRUE)
ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
ifeq ($(USE_ALL_SDC), TRUE)
CEXE_headers += nse_update_simplified_sdc.H
else
ifneq ($(USE_TRUE_SDC), TRUE)
CEXE_headers += nse_update_strang.H
endif
CEXE_headers += nse_update_strang.H
endif
endif

Expand Down
6 changes: 2 additions & 4 deletions integration/RKC/Make.package
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
ifeq ($(USE_ALL_SDC), TRUE)
CEXE_headers += actual_integrator_simplified_sdc.H
else
ifneq ($(USE_TRUE_SDC), TRUE)
CEXE_headers += actual_integrator.H
endif
CEXE_headers += actual_integrator.H
endif

CEXE_headers += rkc_type.H
Expand Down
2 changes: 1 addition & 1 deletion integration/RKC/rkc.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <integrator_type_strang.H>
#include <integrator_rhs_strang.H>
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_type_simplified_sdc.H>
#include <integrator_rhs_simplified_sdc.H>
#endif
Expand Down
2 changes: 1 addition & 1 deletion integration/RKC/rkc_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct rkc_t {

};

#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_type_simplified_sdc.H>
#endif
#ifdef STRANG
Expand Down
6 changes: 2 additions & 4 deletions integration/VODE/Make.package
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
ifeq ($(USE_SIMPLIFIED_SDC), TRUE)
ifeq ($(USE_ALL_SDC), TRUE)
CEXE_headers += actual_integrator_simplified_sdc.H
else
ifneq ($(USE_TRUE_SDC), TRUE)
CEXE_headers += actual_integrator.H
endif
CEXE_headers += actual_integrator.H
endif

# by default we do not enable Jacobian caching on GPUs to save memory
Expand Down
5 changes: 1 addition & 4 deletions integration/VODE/vode_dvhin.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
#ifdef STRANG
#include <integrator_rhs_strang.H>
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_rhs_simplified_sdc.H>
#endif
#ifdef TRUE_SDC
#include <vode_rhs_true_sdc.H>
#endif

template <typename BurnT, typename DvodeT>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Expand Down
5 changes: 1 addition & 4 deletions integration/VODE/vode_dvjac.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
#ifdef STRANG
#include <integrator_rhs_strang.H>
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_rhs_simplified_sdc.H>
#endif
#ifdef TRUE_SDC
#include <vode_rhs_true_sdc.H>
#endif

template <typename IArray1D, typename BurnT, typename DvodeT>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Expand Down
7 changes: 2 additions & 5 deletions integration/VODE/vode_dvode.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
#ifdef STRANG
#include <integrator_rhs_strang.H>
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_rhs_simplified_sdc.H>
#endif
#ifdef TRUE_SDC
#include <vode_rhs_true_sdc.H>
#endif
#ifdef NSE_TABLE
#include <nse_table_check.H>
#endif
Expand Down Expand Up @@ -236,7 +233,7 @@ int dvode (BurnT& state, DvodeT& vstate)
#ifdef STRANG
update_thermodynamics(state, vstate);
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
int_to_burn(vstate.tn, vstate, state);
#endif

Expand Down
10 changes: 7 additions & 3 deletions integration/VODE/vode_dvstep.H
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int dvstep (BurnT& state, DvodeT& vstate)
y_save(i) = vstate.y(i);
}
#endif
#if defined(SIMPLIFIED_SDC) || defined(TRUE_SDC)
#ifdef SDC
Real rho_old = state.rho_orig + TOLD * state.ydot_a[SRHO];
for (int i = 1; i <= int_neqs; ++i) {
y_save(i) = vstate.y(i);
Expand Down Expand Up @@ -224,7 +224,7 @@ int dvstep (BurnT& state, DvodeT& vstate)

bool valid_update = true;

#if defined(SIMPLIFIED_SDC) || defined(TRUE_SDC)
#ifdef SDC
if (vstate.y(SEINT+1) < 0.0_rt) {
valid_update = false;
}
Expand Down Expand Up @@ -259,19 +259,21 @@ int dvstep (BurnT& state, DvodeT& vstate)
// or greater than one (within a tolerance).
if (vstate.y(i) < -species_failure_tolerance) {
valid_update = false;
break;
}

// Don't enforce the condition below if
// vstate.y contains number densities
if (!use_number_densities) {
if (vstate.y(i) > 1.0_rt + species_failure_tolerance) {
valid_update = false;
break;
}
}

#endif

#if defined(SIMPLIFIED_SDC) || defined(TRUE_SDC)
#ifdef SDC

// these are basically the same checks as with Strang
// above, except now we are evolving rhoX instead of X.
Expand All @@ -295,10 +297,12 @@ int dvstep (BurnT& state, DvodeT& vstate)

if (vstate.y(SFS+i) < -species_failure_tolerance * rho_current) {
valid_update = false;
break;
}

if (vstate.y(SFS+i) > (1.0_rt + species_failure_tolerance) * rho_current) {
valid_update = false;
break;
}

#endif
Expand Down
2 changes: 1 addition & 1 deletion integration/VODE/vode_type.H
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ void print_state(dvode_t<int_neqs>& dvode_state)
}
#endif

#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_type_simplified_sdc.H>
#endif
#ifdef STRANG
Expand Down
2 changes: 1 addition & 1 deletion integration/integrator.H
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef INTEGRATOR_H
#define INTEGRATOR_H

#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <actual_integrator_simplified_sdc.H>
#else
#include <actual_integrator.H>
Expand Down
2 changes: 1 addition & 1 deletion integration/utils/circle_theorem.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <integrator_type_strang.H>
#include <integrator_rhs_strang.H>
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <integrator_type_simplified_sdc.H>
#include <integrator_rhs_simplified_sdc.H>
#endif
Expand Down
4 changes: 2 additions & 2 deletions integration/utils/initial_timestep.H
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

template <typename BurnT, typename IntT>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
Real initial_dt (BurnT& burn_state, IntT& int_state,
Array1D<Real, 1, INT_NEQS>& ydot)
Real initial_react_dt (BurnT& burn_state, IntT& int_state,
Array1D<Real, 1, INT_NEQS>& ydot)
{
// this is a version of the initial timestep estimator from VODE
// we come in with int_state..y() storing the initial solution
Expand Down
4 changes: 2 additions & 2 deletions integration/utils/nonaka_plot.H
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void nonaka_init() {
std::stringstream ss;
ss << std::setw(FIELD_WIDTH) << "time" << " ";

#ifdef SIMPLIFIED_SDC
#ifdef SDC
ss << std::setw(FIELD_WIDTH) << "sdc-iter" << " ";
#endif

Expand Down Expand Up @@ -80,7 +80,7 @@ void nonaka_rhs(const Real time, const BurnT& state, const YdotNetArray1D& ydot_

nf << std::setw(FIELD_WIDTH) << simulation_time << " ";

#ifdef SIMPLIFIED_SDC
#ifdef SDC
nf << std::setw(FIELD_WIDTH) << state.sdc_iter << " ";
#endif

Expand Down
12 changes: 4 additions & 8 deletions interfaces/burner.H
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifdef STRANG
#include <nse_update_strang.H>
#endif
#ifdef SIMPLIFIED_SDC
#ifdef SDC
#include <nse_update_simplified_sdc.H>
#endif
#endif
Expand All @@ -26,16 +26,14 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void burner (BurnT& state, Real dt)
{

#ifndef TRUE_SDC

#ifdef NSE

bool nse_check = in_nse(state);

if (nse_check) {

// call the table
#ifdef SIMPLIFIED_SDC
#ifdef SDC
sdc_nse_burn(state, dt);
#else
nse_burn(state, dt);
Expand All @@ -45,7 +43,7 @@ void burner (BurnT& state, Real dt)
// burn as usual
integrator(state, dt);

#if !defined(SIMPLIFIED_SDC) && defined(AUX_THERMO)
#if !defined(SDC) && defined(AUX_THERMO)
// update the aux from the new X's this is not needed with the
// SDC method, since we took care of that internally.
set_aux_comp_from_X(state);
Expand Down Expand Up @@ -74,7 +72,7 @@ void burner (BurnT& state, Real dt)

// This will append to state.e the amount additional
// energy released from adjusting to the new NSE state
#ifdef SIMPLIFIED_SDC
#ifdef SDC
sdc_nse_burn(state, dt_remaining);
#else
nse_burn(state, dt_remaining);
Expand All @@ -94,8 +92,6 @@ void burner (BurnT& state, Real dt)
integrator(state, dt);
#endif

#endif

}

#endif
2 changes: 1 addition & 1 deletion util/gcem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ constexpr
return_t<T>
erf(const T x) noexcept;
```
A set of internal templated `constexpr` functions will implement a continued fraction expansion and return a value of type `return_t<T>`. The output type ('`return_t<T>`') is generally determined by the input type, e.g., `int`, `float`, `double`, `long double`, etc.; when `T` is an intergral type, the output will be upgraded to `return_t<T> = double`, otherwise `return_t<T> = T`. For types not covered by `std::is_integral`, recasts should be used.
A set of internal templated `constexpr` functions will implement a continued fraction expansion and return a value of type `return_t<T>`. The output type ('`return_t<T>`') is generally determined by the input type, e.g., `int`, `float`, `double`, `long double`, etc.; when `T` is an integral type, the output will be upgraded to `return_t<T> = double`, otherwise `return_t<T> = T`. For types not covered by `std::is_integral`, recasts should be used.
## Examples
Expand Down
2 changes: 1 addition & 1 deletion util/gcem/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ GCE-Math functions are written as C++ templates with ``constexpr`` specifiers. F
return_t<T>
erf(const T x) noexcept;
A set of internal templated ``constexpr`` functions will implement a continued fraction expansion and return a value of type ``return_t<T>``. The output type ('``return_t<T>``') is generally determined by the input type, e.g., ``int``, ``float``, ``double``, ``long double``, etc; when ``T`` is an intergral type, the output will be upgraded to ``return_t<T> = double``, otherwise ``return_t<T> = T``. For types not covered by ``std::is_integral``, recasts should be used.
A set of internal templated ``constexpr`` functions will implement a continued fraction expansion and return a value of type ``return_t<T>``. The output type ('``return_t<T>``') is generally determined by the input type, e.g., ``int``, ``float``, ``double``, ``long double``, etc; when ``T`` is an integral type, the output will be upgraded to ``return_t<T> = double``, otherwise ``return_t<T> = T``. For types not covered by ``std::is_integral``, recasts should be used.


Contents
Expand Down
Loading

0 comments on commit b3d7629

Please sign in to comment.