From 4e10ba924e42c36ebc93eec578df9c901ac28dcb Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Sun, 24 Nov 2024 00:38:28 -0500 Subject: [PATCH] More debugging, use local wfact --- docs/src/dev/compute_convergence.jl | 6 ++++-- test/problems.jl | 19 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/src/dev/compute_convergence.jl b/docs/src/dev/compute_convergence.jl index 84bca4daa..e3daed615 100644 --- a/docs/src/dev/compute_convergence.jl +++ b/docs/src/dev/compute_convergence.jl @@ -279,8 +279,10 @@ function compute_convergence!( mkpath(out_path) fname(i) = replace("$(key1)_$(key2)_step_$(i).png", " " => "_", "(" => "", ")" => "") for (i, u) in enumerate(plot2_values.u) - f = joinpath(out_path, fname(i)) - Plots.png(Plots.plot(u.u), joinpath(out_path, fname(i))) + if !all(isnan, u.u) + f = joinpath(out_path, fname(i)) + Plots.png(Plots.plot(u.u), joinpath(out_path, fname(i))) + end end # error("NaN found in plot2_values in problem $(test_name)") end diff --git a/test/problems.jl b/test/problems.jl index 386da7d89..5dc049662 100644 --- a/test/problems.jl +++ b/test/problems.jl @@ -510,15 +510,24 @@ function climacore_2Dheat_test_cts(::Type{FT}) where {FT} dss_tendency && Spaces.weighted_dss!(tendency.u) _FT = Spaces.undertype(axes(state.u)) set_boundaries!(tendency.u, _FT(0)) - e1 = extrema(divgradu) - e2 = extrema(src_term) - e3 = extrema(φ_sin_sin_term) - @show e1, e2, e3, exp_term + if t ≤ t_end*0.01 + e0 = extrema(state.u) + e1 = extrema(divgradu) + @show e0, e1, count(isnan, parent(state.u)), length(parent(state.u)) + end return nothing end function dss!(state, _, t) + if t ≤ t_end*0.01 + e0_dss = extrema(state.u) + @show e0_dss, count(isnan, parent(state.u)), length(parent(state.u)) + end dss_tendency || Spaces.weighted_dss!(state.u) + if t ≤ t_end*0.01 + e1_dss = extrema(state.u) + @show e1_dss, count(isnan, parent(state.u)), length(parent(state.u)) + end end function analytic_sol(t) @@ -537,7 +546,7 @@ function climacore_2Dheat_test_cts(::Type{FT}) where {FT} T_imp! = SciMLBase.ODEFunction( (Yₜ, u, _, t) -> nothing; jac_prototype = FieldMatrixWithSolver(jacobian, init_state), - Wfact = Wfact!, + Wfact = (W, Y, p, dtγ, t) -> nothing, tgrad = (∂Y∂t, Y, p, t) -> (∂Y∂t .= 0), )