diff --git a/src/callbacks_step/alive.jl b/src/callbacks_step/alive.jl index 9df7181521..9700f7e4cd 100644 --- a/src/callbacks_step/alive.jl +++ b/src/callbacks_step/alive.jl @@ -68,7 +68,6 @@ function (alive_callback::AliveCallback)(u, t, integrator) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. return alive_interval > 0 && ((integrator.stats.naccept % alive_interval == 0 && - !(integrator.stats.naccept == 0 && integrator.iter > 0) && (analysis_interval == 0 || integrator.stats.naccept % analysis_interval != 0)) || isfinished(integrator)) diff --git a/src/callbacks_step/analysis.jl b/src/callbacks_step/analysis.jl index 8f89af755a..7b4a97c2a7 100644 --- a/src/callbacks_step/analysis.jl +++ b/src/callbacks_step/analysis.jl @@ -26,8 +26,8 @@ or `extra_analysis_errors = (:conservation_error,)`. If you want to omit the computation (to safe compute-time) of the [`default_analysis_errors`](@ref), specify `analysis_errors = Symbol[]`. Note: `default_analysis_errors` are `:l2_error` and `:linf_error` for all equations. -If you want to compute `extra_analysis_errors` such as `:conservation_error` solely, i.e., -without `:l2_error, :linf_error` you need to specify +If you want to compute `extra_analysis_errors` such as `:conservation_error` solely, i.e., +without `:l2_error, :linf_error` you need to specify `analysis_errors = [:conservation_error]` instead of `extra_analysis_errors = [:conservation_error]`. Further scalar functions `func` in `extra_analysis_integrals` are applied to the numerical @@ -119,9 +119,7 @@ function AnalysisCallback(mesh, equations::AbstractEquations, solver, cache; # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. condition = (u, t, integrator) -> interval > 0 && - ((integrator.stats.naccept % interval == 0 && - !(integrator.stats.naccept == 0 && integrator.iter > 0)) || - isfinished(integrator)) + (integrator.stats.naccept % interval == 0 || isfinished(integrator)) analyzer = SolutionAnalyzer(solver; kwargs...) cache_analysis = create_cache_analysis(analyzer, mesh, equations, solver, cache, @@ -696,7 +694,7 @@ include("analysis_dg3d_parallel.jl") # Special analyze for `SemidiscretizationHyperbolicParabolic` such that # precomputed gradients are available. Required for `enstrophy` (see above) and viscous forces. -# Note that this needs to be included after `analysis_surface_integral_2d.jl` to +# Note that this needs to be included after `analysis_surface_integral_2d.jl` to # have `VariableViscous` available. function analyze(quantity::AnalysisSurfaceIntegral{Variable}, du, u, t, diff --git a/src/callbacks_step/save_restart.jl b/src/callbacks_step/save_restart.jl index 0d174d8580..0b0d2420c7 100644 --- a/src/callbacks_step/save_restart.jl +++ b/src/callbacks_step/save_restart.jl @@ -83,8 +83,7 @@ function (restart_callback::SaveRestartCallback)(u, t, integrator) # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. - return interval > 0 && (((integrator.stats.naccept % interval == 0) && - !(integrator.stats.naccept == 0 && integrator.iter > 0)) || + return interval > 0 && (integrator.stats.naccept % interval == 0 || (save_final_restart && isfinished(integrator))) end @@ -198,7 +197,7 @@ function load_adaptive_time_integrator!(integrator, restart_file::AbstractString # Reevaluate integrator.fsal_first on the first step integrator.reeval_fsal = true # Load additional parameters for PIDController - if hasproperty(controller, :err) # Distinguish PIDController from PIController + if hasproperty(controller, :err) # Distinguish PIDController from PIController controller.err[:] = read(attributes(file)["time_integrator_controller_err"]) end end diff --git a/src/callbacks_step/save_solution.jl b/src/callbacks_step/save_solution.jl index c106fe69bc..870cea0b9f 100644 --- a/src/callbacks_step/save_solution.jl +++ b/src/callbacks_step/save_solution.jl @@ -174,8 +174,7 @@ function (solution_callback::SaveSolutionCallback)(u, t, integrator) # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. - return interval_or_dt > 0 && (((integrator.stats.naccept % interval_or_dt == 0) && - !(integrator.stats.naccept == 0 && integrator.iter > 0)) || + return interval_or_dt > 0 && (integrator.stats.naccept % interval_or_dt == 0 || (save_final_solution && isfinished(integrator))) end diff --git a/src/callbacks_step/visualization.jl b/src/callbacks_step/visualization.jl index 98c0126a30..30ac88e9fd 100644 --- a/src/callbacks_step/visualization.jl +++ b/src/callbacks_step/visualization.jl @@ -137,8 +137,7 @@ function (visualization_callback::VisualizationCallback)(u, t, integrator) # (total #steps) (#accepted steps) # We need to check the number of accepted steps since callbacks are not # activated after a rejected step. - return interval > 0 && ((integrator.stats.naccept % interval == 0 && - !(integrator.stats.naccept == 0 && integrator.iter > 0)) || + return interval > 0 && (integrator.stats.naccept % interval == 0 || isfinished(integrator)) end