Skip to content

Commit

Permalink
makie-fixes: Remove divergence at vpa=0 when plotting f/vpa^2
Browse files Browse the repository at this point in the history
  • Loading branch information
johnomotani committed Oct 23, 2023
1 parent c231741 commit d8bd486
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/makie_post_processing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4070,7 +4070,13 @@ function plot_f_unnorm_vs_vpa(run_info; f_over_vpa2=false, input=nothing, neutra
run_info.evolve_ppar)

if f_over_vpa2
@. f_unnorm /= dzdt^2
dzdt2 = dzdt.^2
for i eachindex(dzdt2)
if dzdt2[i] == 0.0
dzdt2[i] = 1.0
end
end
f_unnorm ./= dzdt2
end

f_unnorm = transform.(f_unnorm)
Expand Down Expand Up @@ -4403,7 +4409,14 @@ function animate_f_unnorm_vs_vpa(run_info; f_over_vpa2=false, input=nothing,
if f_over_vpa2
dzdt = vpagrid_to_dzdt(run_info.vpa.grid, vth[it], upar[it],
run_info.evolve_ppar, run_info.evolve_upar)
f_unnorm = @. copy(f_unnorm) / dzdt^2
dzdt2 = dzdt.^2
for i eachindex(dzdt2)
if dzdt2[i] == 0.0
dzdt2[i] = 1.0
end
end

f_unnorm = @. copy(f_unnorm) / dzdt2
end

return f_unnorm
Expand Down

0 comments on commit d8bd486

Please sign in to comment.