From 1bbc944eeb46770860114dca360a1d2b7d3c0105 Mon Sep 17 00:00:00 2001 From: Michael Zingale Date: Thu, 12 Oct 2023 12:38:26 -0400 Subject: [PATCH] fix location of check --- Source/sdc/sdc_newton_solve.H | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/sdc/sdc_newton_solve.H b/Source/sdc/sdc_newton_solve.H index 3c95bb202e..500e31092e 100644 --- a/Source/sdc/sdc_newton_solve.H +++ b/Source/sdc/sdc_newton_solve.H @@ -288,21 +288,20 @@ sdc_newton_subdivide(const Real dt_m, sdc_newton_solve(dt_sub, U_begin, U_new, C, sdc_iteration, err_out, ierr); - if (ierr != newton::NEWTON_SUCCESS) { - // no point in continuing this subdivision if one stage failed - break; - } - // our solve may have resulted in mass fractions outside // of [0, 1] -- reject if this is the case for (int n = 0; n < NumSpec; ++n) { if (U_new[UFS+n] < -newton::species_failure_tolerance * U_new[URHO] || U_new[UFS+n] > (1.0_rt + newton::species_failure_tolerance) * U_new[URHO]) { ierr = newton::BAD_MASS_FRACTIONS; - break; } } + if (ierr != newton::NEWTON_SUCCESS) { + // no point in continuing this subdivision if one stage failed + break; + } + for (int n = 0; n < NUM_STATE; ++n) { U_begin[n] = U_new[n]; }