Skip to content

Commit

Permalink
Add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Nov 22, 2024
1 parent 0a6649c commit af684ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ steps:

- label: "Summarize convergence"
command: "julia --color=yes --check-bounds=yes --project=.buildkite docs/src/dev/summarize_convergence.jl"
artifact_paths: "output/*"
artifact_paths:
- "output/*"
- "output/convergence_failure/*"
depends_on: alg_convergence

- label: "Summarize limiter analysis"
Expand Down
17 changes: 16 additions & 1 deletion docs/src/dev/compute_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,9 @@ function compute_convergence!(
float_str(x) = @sprintf "%.4f" x
pow_str(x) = "10^{$(@sprintf "%.1f" log10(x))}"
function si_str(x)
x in (0, Inf, -Inf, NaN) && return string(x)
if isnan(x) || x in (0, Inf, -Inf)
return string(x)
end
exponent = floor(Int, log10(x))
mantissa = x / 10.0^exponent
return "$(float_str(mantissa)) \\times 10^{$exponent}"
Expand Down Expand Up @@ -266,6 +268,19 @@ function compute_convergence!(
callback = scb_cur_avg_sol_and_err,
)
if any(isnan, plot2_values)
@show test_name
@show default_dt
@show count(isnan, plot2_values.u[end])
@show length(plot2_values.u[end])
@show count(isnan, plot2_values.u[1])
@show length(plot2_values.u[1])
out_path = joinpath("output", "convergence_failure")
mkpath(out_path)
fname(i) = "$(key1)_$(key2)_step_$(i).png"
for (i, u) in enumerate(plot2_values.u)
@show extrema(u.u)
Plots.png(Plots.plot(u.u), joinpath(out_path, fname(i)))
end
error("NaN found in plot2_values in problem $(test_name)")
end
out_dict[key1][key2]["plot2_values"] = plot2_values
Expand Down

0 comments on commit af684ca

Please sign in to comment.