Skip to content

Commit

Permalink
fix foundoff issues in SUNDIALS evolve()
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnonaka committed Sep 12, 2024
1 parent 4460afb commit 0c79af8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/Base/AMReX_RKIntegrator.H
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ public:
for (int step_number = 0; step_number < BaseT::max_steps && !stop; ++step_number)
{
// Adjust step size to reach output time
if (time_out - time_current < dt) {
// protect against roundoff
if (std::abs(time_out - time_current - dt) <= 1.e5 * std::numeric_limits<amrex::Real>::epsilon() * std::abs(dt)) {
dt = time_out - time_current;
stop = true;
}
Expand Down

0 comments on commit 0c79af8

Please sign in to comment.