From e26710b3369e6137754581e8d6999d04629cf0cb Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Tue, 12 Nov 2024 11:35:21 +0100 Subject: [PATCH] Print in Full Precision --- src/callbacks_step/analysis.jl | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/callbacks_step/analysis.jl b/src/callbacks_step/analysis.jl index 0a26bbdbebe..13b439d8d55 100644 --- a/src/callbacks_step/analysis.jl +++ b/src/callbacks_step/analysis.jl @@ -164,41 +164,41 @@ function initialize!(cb::DiscreteCallback{Condition, Affect!}, u_ode, du_ode, t, # write header of output file open(joinpath(output_directory, analysis_filename), "w") do io @printf(io, "#%-8s", "timestep") - @printf(io, " %-14s", "time") - @printf(io, " %-14s", "dt") + @printf(io, " %-21s", "time") + @printf(io, " %-21s", "dt") if :l2_error in analysis_errors for v in varnames(cons2cons, equations) - @printf(io, " %-14s", "l2_"*v) + @printf(io, " %-21s", "l2_"*v) end end if :linf_error in analysis_errors for v in varnames(cons2cons, equations) - @printf(io, " %-14s", "linf_"*v) + @printf(io, " %-21s", "linf_"*v) end end if :conservation_error in analysis_errors for v in varnames(cons2cons, equations) - @printf(io, " %-14s", "cons_"*v) + @printf(io, " %-21s", "cons_"*v) end end if :residual in analysis_errors for v in varnames(cons2cons, equations) - @printf(io, " %-14s", "res_"*v) + @printf(io, " %-21s", "res_"*v) end end if :l2_error_primitive in analysis_errors for v in varnames(cons2prim, equations) - @printf(io, " %-14s", "l2_"*v) + @printf(io, " %-21s", "l2_"*v) end end if :linf_error_primitive in analysis_errors for v in varnames(cons2prim, equations) - @printf(io, " %-14s", "linf_"*v) + @printf(io, " %-21s", "linf_"*v) end end for quantity in analysis_integrals - @printf(io, " %-14s", pretty_form_ascii(quantity)) + @printf(io, " %-21s", pretty_form_ascii(quantity)) end println(io) @@ -323,8 +323,8 @@ function (analysis_callback::AnalysisCallback)(u_ode, du_ode, integrator, semi) io = open(joinpath(analysis_callback.output_directory, analysis_callback.analysis_filename), "a") @printf(io, "% 9d", iter) - @printf(io, " %10.8e", t) - @printf(io, " %10.8e", dt) + @printf(io, " %10.15e", t) + @printf(io, " %10.15e", dt) else io = devnull end @@ -377,7 +377,7 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) mpi_isroot() print(" Variable: ") for v in eachvariable(equations) - @printf(" %-14s", varnames(cons2cons, equations)[v]) + @printf(" %-21s", varnames(cons2cons, equations)[v]) end println() end @@ -393,7 +393,7 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) print(" L2 error: ") for v in eachvariable(equations) @printf(" % 10.8e", l2_error[v]) - @printf(io, " % 10.8e", l2_error[v]) + @printf(io, " % 10.15e", l2_error[v]) end println() end @@ -403,7 +403,7 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) print(" Linf error: ") for v in eachvariable(equations) @printf(" % 10.8e", linf_error[v]) - @printf(io, " % 10.8e", linf_error[v]) + @printf(io, " % 10.15e", linf_error[v]) end println() end @@ -420,7 +420,7 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) for v in eachvariable(equations) err = abs(state_integrals[v] - initial_state_integrals[v]) @printf(" % 10.8e", err) - @printf(io, " % 10.8e", err) + @printf(io, " % 10.15e", err) end println() end @@ -442,7 +442,7 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) end if mpi_isroot() @printf(" % 10.8e", res) - @printf(io, " % 10.8e", res) + @printf(io, " % 10.15e", res) end end mpi_println() @@ -457,7 +457,7 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) if mpi_isroot() print(" Variable: ") for v in eachvariable(equations) - @printf(" %-14s", varnames(cons2prim, equations)[v]) + @printf(" %-21s", varnames(cons2prim, equations)[v]) end println() @@ -466,7 +466,7 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) print(" L2 error prim.: ") for v in eachvariable(equations) @printf("%10.8e ", l2_error_prim[v]) - @printf(io, " % 10.8e", l2_error_prim[v]) + @printf(io, " % 10.15e", l2_error_prim[v]) end println() end @@ -476,7 +476,7 @@ function (analysis_callback::AnalysisCallback)(io, du, u, u_ode, t, semi) print(" Linf error pri.:") for v in eachvariable(equations) @printf("%10.8e ", linf_error_prim[v]) - @printf(io, " % 10.8e", linf_error_prim[v]) + @printf(io, " % 10.15e", linf_error_prim[v]) end println() end @@ -581,7 +581,7 @@ function analyze_integrals(analysis_integrals::NTuple{N, Any}, io, du, u, t, if mpi_isroot() @printf(" %-12s:", pretty_form_utf(quantity)) @printf(" % 10.8e", res) - @printf(io, " % 10.8e", res) + @printf(io, " % 10.15e", res) end mpi_println()