diff --git a/src/callbacks_stage/subcell_bounds_check.jl b/src/callbacks_stage/subcell_bounds_check.jl index 04b8b4a0652..919cac3ae23 100644 --- a/src/callbacks_stage/subcell_bounds_check.jl +++ b/src/callbacks_stage/subcell_bounds_check.jl @@ -29,30 +29,30 @@ function (callback::BoundsCheckCallback)(u_ode, integrator, stage) u = wrap_array(u_ode, mesh, equations, solver, cache) save_errors_ = callback.save_errors && (callback.interval > 0) && - (stage == length(alg.c)) + (iter % callback.interval == 0) && (stage == length(alg.c)) @trixi_timeit timer() "check_bounds" check_bounds(u, mesh, equations, solver, cache, t, iter + 1, callback.output_directory, - save_errors_, callback.interval) + save_errors_) end function check_bounds(u, mesh, equations, solver, cache, t, iter, output_directory, - save_errors, interval) + save_errors) check_bounds(u, mesh, equations, solver, cache, solver.volume_integral, t, iter, - output_directory, save_errors, interval) + output_directory, save_errors) end function check_bounds(u, mesh, equations, solver, cache, - volume_integral::AbstractVolumeIntegral, - t, iter, output_directory, save_errors, interval) + volume_integral::AbstractVolumeIntegral, t, iter, + output_directory, save_errors) return nothing end function check_bounds(u, mesh, equations, solver, cache, - volume_integral::VolumeIntegralSubcellLimiting, - t, iter, output_directory, save_errors, interval) + volume_integral::VolumeIntegralSubcellLimiting, t, iter, + output_directory, save_errors) check_bounds(u, mesh, equations, solver, cache, volume_integral.limiter, t, iter, - output_directory, save_errors, interval) + output_directory, save_errors) end function init_callback(callback, semi) diff --git a/src/callbacks_stage/subcell_bounds_check_2d.jl b/src/callbacks_stage/subcell_bounds_check_2d.jl index b021f4f2132..79b0925c444 100644 --- a/src/callbacks_stage/subcell_bounds_check_2d.jl +++ b/src/callbacks_stage/subcell_bounds_check_2d.jl @@ -7,13 +7,12 @@ @inline function check_bounds(u, mesh::AbstractMesh{2}, equations, solver, cache, limiter::SubcellLimiterIDP, - time, iter, output_directory, save_errors, interval) + time, iter, output_directory, save_errors) (; positivity) = solver.volume_integral.limiter (; variable_bounds) = limiter.cache.subcell_limiter_coefficients (; idp_bounds_delta) = limiter.cache - save_errors_ = save_errors && (iter % interval == 0) - if save_errors_ + if save_errors open("$output_directory/deviations.txt", "a") do f print(f, iter, ", ", time) end @@ -30,7 +29,7 @@ variable_bounds[key][i, j, element] - var) end idp_bounds_delta[key] = max(idp_bounds_delta[key], deviation_min) - if save_errors_ + if save_errors deviation_min_ = deviation_min open("$output_directory/deviations.txt", "a") do f print(f, ", ", deviation_min_) @@ -38,7 +37,7 @@ end end end - if save_errors_ + if save_errors open("$output_directory/deviations.txt", "a") do f println(f) end