Skip to content

Commit

Permalink
print in if clause
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Dec 5, 2023
1 parent 4e324c7 commit b48d6af
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/callbacks_step/analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -388,30 +388,30 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi)
# Calculate L2/Linf errors, which are also returned
l2_error, linf_error = calc_error_norms(u_ode, t, analyzer, semi,
cache_analysis)
else
return nothing
end

if mpi_isroot()
# L2 error
if :l2_error in analysis_errors
print(" L2 error: ")
for v in eachvariable(equations)
@printf(" % 10.8e", l2_error[v])
@printf(io, " % 10.8e", l2_error[v])
if mpi_isroot()
# L2 error
if :l2_error in analysis_errors
print(" L2 error: ")
for v in eachvariable(equations)
@printf(" % 10.8e", l2_error[v])
@printf(io, " % 10.8e", l2_error[v])
end
println()
end
println()
end

# Linf error
if :linf_error in analysis_errors
print(" Linf error: ")
for v in eachvariable(equations)
@printf(" % 10.8e", linf_error[v])
@printf(io, " % 10.8e", linf_error[v])
# Linf error
if :linf_error in analysis_errors
print(" Linf error: ")
for v in eachvariable(equations)
@printf(" % 10.8e", linf_error[v])
@printf(io, " % 10.8e", linf_error[v])
end
println()
end
println()
end
else
return nothing
end

# Conservation error
Expand Down

0 comments on commit b48d6af

Please sign in to comment.