From 424772c7bb85b3135539ea20c1bced6af982dd87 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Thu, 23 Nov 2023 13:57:23 +0100 Subject: [PATCH] Make error norm calculation optional --- src/callbacks_step/analysis.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/callbacks_step/analysis.jl b/src/callbacks_step/analysis.jl index e5b4a01a885..46012def62d 100644 --- a/src/callbacks_step/analysis.jl +++ b/src/callbacks_step/analysis.jl @@ -377,8 +377,14 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) println() end - # Calculate L2/Linf errors, which are also returned - l2_error, linf_error = calc_error_norms(u_ode, t, analyzer, semi, cache_analysis) + if :l2_error in analysis_errors || :linf_error in analysis_errors + # Calculate L2/Linf errors, which are also returned + l2_error, linf_error = calc_error_norms(u_ode, t, analyzer, semi, + cache_analysis) + else # Need something to be returned + l2_error = nothing + linf_error = nothing + end if mpi_isroot() # L2 error