Skip to content

Commit

Permalink
Fix NaNs check, add more debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Nov 15, 2024
1 parent 0c57a2f commit fd939a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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,9 @@ function compute_convergence!(
callback = scb_cur_avg_sol_and_err,
)
if any(isnan, plot2_values)
@show default_dt
@show count(isnan, plot2_values.u[end])
@show length(plot2_values.u[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 fd939a4

Please sign in to comment.