Skip to content

Commit 844166b

Browse files
authored
Remove YASS (#2014)
Removes the YASS method from integrators/Rosenbrock.
1 parent 4bad094 commit 844166b

4 files changed

Lines changed: 13 additions & 71 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# latex intermediates
23
*.aux
34
*.log

Docs/source/ode_integrators.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ Presently, allowed integrators are:
7272

7373
* ``4`` : ROS2 method, a 2nd order, L-stable method :cite:`ros2`.
7474

75-
* ``5`` : a first-order method based on the YASS method (described in :cite:`YASS`).
75+
* ``5`` : Rosenbrock-Euler, a first-order method.
7676

7777
Here the "P" suffix refers to methods developed to satisfy the stiff
7878
accuracy conditions of :cite:`Prothero1974` (ROS2S also satisfies
7979
these).
8080

81-
By default, the H211b error-history timestep controller from :cite:`h211b` (see Eq. 31) is used, but the YASS heuristic method can be used instead by setting ``integrator.rosenbrock_timestep_controller=1``.
81+
The H211b error-history timestep controller from :cite:`h211b` (see Eq. 31) is used.
8282

8383
* ``VODE``: the VODE :cite:`vode` integration package. We ported this
8484
integrator to C++ and removed the non-stiff integration code paths.

integration/Rosenbrock/_parameters

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,9 @@ X_reject_buffer real 1.0
1313
# 5 = Rosenbrock-Euler 1-stage method
1414
rosenbrock_tableau int 0
1515

16-
# Timestep controller selector:
17-
# 0 = H211b error-history controller
18-
# 1 = Khokhlov/YASS concentration-change controller
19-
rosenbrock_timestep_controller int 0
20-
2116
# H211b timestep controller parameters
2217
h211b_b real 4.0
2318
h211b_k real 2.5
2419
h211b_fac_min real 0.2
2520
h211b_fac_max real 6.0
2621
h211b_reduction_fac real 0.5
27-
28-
# Khokhlov/YASS timestep controller parameters. This controller accepts a
29-
# step when each active species changes by no more than yass_epsilon
30-
# relative to its starting value. Species with concentration <= yass_floor
31-
# times the most abundant species do not constrain the step.
32-
yass_epsilon real 0.1
33-
yass_floor real 1.e-3
34-
yass_fac_min real 0.2
35-
yass_fac_max real 6.0
36-
yass_reduction_fac real 0.5

integration/Rosenbrock/rosenbrock_integrator.H

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -171,29 +171,6 @@ bool species_change_valid (const rosenbrock_t<int_neqs>& rstate)
171171
return true;
172172
}
173173

174-
template <int int_neqs>
175-
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
176-
amrex::Real yass_change_norm (const rosenbrock_t<int_neqs>& rstate)
177-
{
178-
amrex::Real max_change = 0.0_rt;
179-
amrex::Real max_species = 0.0_rt;
180-
181-
for (int i = 1; i <= NumSpec && i <= int_neqs; ++i) {
182-
max_species = amrex::max(max_species, std::abs(rstate.y(i)));
183-
}
184-
185-
const amrex::Real active_floor = integrator_rp::yass_floor * max_species;
186-
187-
for (int i = 1; i <= NumSpec && i <= int_neqs; ++i) {
188-
const amrex::Real yi = std::abs(rstate.y(i));
189-
if (yi > active_floor) {
190-
max_change = amrex::max(max_change, std::abs(rstate.ynew(i) - rstate.y(i)) / yi);
191-
}
192-
}
193-
194-
return max_change / integrator_rp::yass_epsilon;
195-
}
196-
197174
template <typename MatrixType, int int_neqs>
198175
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
199176
bool matrix_is_finite (const MatrixType& matrix)
@@ -381,15 +358,6 @@ int rosenbrock_integrator (BurnT& state, rosenbrock_t<integrator_neqs<BurnT>()>&
381358
}
382359
}
383360

384-
if (integrator_rp::rosenbrock_timestep_controller == 1 &&
385-
(integrator_rp::yass_epsilon <= 0.0_rt ||
386-
integrator_rp::yass_floor < 0.0_rt ||
387-
integrator_rp::yass_fac_min <= 0.0_rt ||
388-
integrator_rp::yass_fac_max < integrator_rp::yass_fac_min ||
389-
integrator_rp::yass_reduction_fac <= 0.0_rt)) {
390-
return IERR_BAD_INPUTS;
391-
}
392-
393361
rstate.n_rhs = 0;
394362
rstate.n_jac = 0;
395363
rstate.n_step = 0;
@@ -564,22 +532,13 @@ int rosenbrock_integrator (BurnT& state, rosenbrock_t<integrator_neqs<BurnT>()>&
564532
const bool valid_update = rosenbrock::species_change_valid(rstate);
565533
constexpr amrex::Real err_min = 1.e-10_rt;
566534
amrex::Real err = rosenbrock::error_norm(rstate);
567-
amrex::Real controller_fac = 1.0_rt;
568-
569-
if (integrator_rp::rosenbrock_timestep_controller == 1) {
570-
err = rosenbrock::yass_change_norm(rstate);
571-
controller_fac = amrex::Clamp(1.0_rt / amrex::max(err, err_min),
572-
integrator_rp::yass_fac_min,
573-
integrator_rp::yass_fac_max);
574-
} else {
575-
controller_fac = amrex::Clamp(
576-
std::pow(1.0_rt / amrex::max(err, err_min),
577-
1.0_rt / (integrator_rp::h211b_b * integrator_rp::h211b_k)) *
578-
std::pow(1.0_rt / amrex::max(errold, err_min),
579-
1.0_rt / (integrator_rp::h211b_b * integrator_rp::h211b_k)) *
580-
std::pow(facold, -1.0_rt / integrator_rp::h211b_b),
581-
integrator_rp::h211b_fac_min, integrator_rp::h211b_fac_max);
582-
}
535+
amrex::Real controller_fac = amrex::Clamp(
536+
std::pow(1.0_rt / amrex::max(err, err_min),
537+
1.0_rt / (integrator_rp::h211b_b * integrator_rp::h211b_k)) *
538+
std::pow(1.0_rt / amrex::max(errold, err_min),
539+
1.0_rt / (integrator_rp::h211b_b * integrator_rp::h211b_k)) *
540+
std::pow(facold, -1.0_rt / integrator_rp::h211b_b),
541+
integrator_rp::h211b_fac_min, integrator_rp::h211b_fac_max);
583542
facold = controller_fac;
584543
errold = err;
585544

@@ -613,14 +572,11 @@ int rosenbrock_integrator (BurnT& state, rosenbrock_t<integrator_neqs<BurnT>()>&
613572
n_reject += 1;
614573
last = false;
615574
if (n_reject >= 2) {
616-
hnew *= integrator_rp::rosenbrock_timestep_controller == 1 ?
617-
integrator_rp::yass_reduction_fac : integrator_rp::h211b_reduction_fac;
575+
hnew *= integrator_rp::h211b_reduction_fac;
618576
}
619577
if (valid_update) {
620-
const amrex::Real reject_fac =
621-
integrator_rp::rosenbrock_timestep_controller == 1 ?
622-
integrator_rp::yass_reduction_fac : integrator_rp::h211b_reduction_fac;
623-
h = posneg * amrex::min(std::abs(hnew), reject_fac * std::abs(h));
578+
h = posneg * amrex::min(std::abs(hnew),
579+
integrator_rp::h211b_reduction_fac * std::abs(h));
624580
} else {
625581
h *= 0.25_rt;
626582
}

0 commit comments

Comments
 (0)