Skip to content

Commit 6358974

Browse files
authored
Merge branch 'development' into fix_atol_sdc
2 parents cb1e8ae + 143bfd7 commit 6358974

File tree

7 files changed

+18
-16
lines changed

7 files changed

+18
-16
lines changed

integration/BackwardEuler/be_integrator.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ int single_step (BurnT& state, BeT& be, const amrex::Real dt)
6060
if (integrator_rp::do_corrector_validation) {
6161
#ifdef SDC
6262
const amrex::Real rho_current = state.rho_orig + be.t * state.ydot_a[SRHO];
63-
const amrex::Real thresh = species_failure_tolerance * rho_current;
63+
const amrex::Real thresh = integrator_rp::species_failure_tolerance * rho_current;
6464
#else
65-
const amrex::Real thresh = species_failure_tolerance;
65+
const amrex::Real thresh = integrator_rp::species_failure_tolerance;
6666
#endif
6767
bool fail{};
6868
for (int i = 1; i <= NumSpec; ++i) {

integration/VODE/vode_dvnlsd.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ amrex::Real dvnlsd (int& NFLAG, BurnT& state, DvodeT& vstate)
151151
if (integrator_rp::do_corrector_validation && !integrator_rp::use_number_densities) {
152152
#ifdef SDC
153153
const amrex::Real rho_current = state.rho_orig + vstate.tn * state.ydot_a[SRHO];
154-
const amrex::Real thresh = species_failure_tolerance * rho_current;
154+
const amrex::Real thresh = integrator_rp::species_failure_tolerance * rho_current;
155155
#else
156-
const amrex::Real thresh = species_failure_tolerance;
156+
const amrex::Real thresh = integrator_rp::species_failure_tolerance;
157157
#endif
158158
bool fail{};
159159
for (int i = 1; i <= NumSpec; ++i) {

integration/VODE/vode_dvstep.H

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,15 @@ int dvstep (BurnT& state, DvodeT& vstate)
244244

245245
// Constrain abundances such that they are not negative (within a tolerance)
246246
// or greater than one (within a tolerance).
247-
if (vstate.y(i) < -species_failure_tolerance) {
247+
if (vstate.y(i) < -integrator_rp::species_failure_tolerance) {
248248
valid_update = false;
249249
break;
250250
}
251251

252252
// Don't enforce the condition below if
253253
// vstate.y contains number densities
254254
if (! integrator_rp::use_number_densities) {
255-
if (vstate.y(i) > 1.0_rt + species_failure_tolerance) {
255+
if (vstate.y(i) > 1.0_rt + integrator_rp::species_failure_tolerance) {
256256
valid_update = false;
257257
break;
258258
}
@@ -286,12 +286,12 @@ int dvstep (BurnT& state, DvodeT& vstate)
286286
break;
287287
}
288288

289-
if (vstate.y(SFS+i) < -species_failure_tolerance * rho_current) {
289+
if (vstate.y(SFS+i) < -integrator_rp::species_failure_tolerance * rho_current) {
290290
valid_update = false;
291291
break;
292292
}
293293

294-
if (vstate.y(SFS+i) > (1.0_rt + species_failure_tolerance) * rho_current) {
294+
if (vstate.y(SFS+i) > (1.0_rt + integrator_rp::species_failure_tolerance) * rho_current) {
295295
valid_update = false;
296296
break;
297297
}

integration/_parameters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,9 @@ nse_include_enu_weak bool 1
117117

118118
# for the linear algebra, do we allow pivoting?
119119
linalg_do_pivoting bool 1
120+
121+
# We will use this parameter to determine if a given species
122+
# abundance is unreasonably small or large (each X must satisfy
123+
# -failure_tolerance <= X <= 1.0 + failure_tolerance).
124+
species_failure_tolerance real 1.e-2_rt
125+

integration/integrator_data.H

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
constexpr int INT_NEQS = NumSpec + 1;
1111

12-
// We will use this parameter to determine if a given species
13-
// abundance is unreasonably small or large (each X must satisfy
14-
// -failure_tolerance <= X <= 1.0 + failure_tolerance).
15-
constexpr amrex::Real species_failure_tolerance = 1.e-2_rt;
1612

1713
// for outputting the burn state failure, use enough precision
1814
// to be reproducible (not guaranteed for std::fixed)

integration/integrator_setup_sdc.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ void integrator_cleanup (IntegratorT& int_state, BurnT& state,
186186
}
187187

188188
for (int n = 0; n < NumSpec; ++n) {
189-
if (state.y[SFS+n] < -state.rho * species_failure_tolerance) {
189+
if (state.y[SFS+n] < -state.rho * integrator_rp::species_failure_tolerance) {
190190
state.success = false;
191191
}
192192

193-
if (state.y[SFS+n] > state.rho * (1.0_rt + species_failure_tolerance)) {
193+
if (state.y[SFS+n] > state.rho * (1.0_rt + integrator_rp::species_failure_tolerance)) {
194194
state.success = false;
195195
}
196196
}

integration/integrator_setup_strang.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ void integrator_cleanup (IntegratorT& int_state, BurnT& state,
155155
}
156156

157157
for (int n = 1; n <= NumSpec; ++n) {
158-
if (int_state.y(n) < -species_failure_tolerance) {
158+
if (int_state.y(n) < -integrator_rp::species_failure_tolerance) {
159159
state.success = false;
160160
}
161161

162162
// Don't enforce a max if we are evolving number densities
163163

164164
if (! integrator_rp::use_number_densities) {
165-
if (int_state.y(n) > 1.0_rt + species_failure_tolerance) {
165+
if (int_state.y(n) > 1.0_rt + integrator_rp::species_failure_tolerance) {
166166
state.success = false;
167167
}
168168
}

0 commit comments

Comments
 (0)