Skip to content

Commit

Permalink
Fix runtime plots when no neutral species is present
Browse files Browse the repository at this point in the history
Need to skip plotting neutral moments in runtime plots (neutral
distribution function plots were already skipped).
  • Loading branch information
johnomotani committed Sep 11, 2023
1 parent 2ca5095 commit 3e1fdfc
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/time_advance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -911,29 +911,39 @@ function time_advance!(pdf, scratch, t, t_input, vz, vr, vzeta, vpa, vperp, gyro
layout = fig[irow,1] = GridLayout()
ax = Axis(layout[1,1], xlabel="z", ylabel="density", width=ax_width, height=ax_height)
plot_1d(z.grid, moments.charged.dens[:,1,1]; ax=ax, label="ion")
plot_1d(z.grid, moments.neutral.dens[:,1,1]; ax=ax, label="neutral")
if composition.n_neutral_species > 0
plot_1d(z.grid, moments.neutral.dens[:,1,1]; ax=ax, label="neutral")
end
#axislegend(ax)
ax = Axis(layout[1,2], xlabel="z", ylabel="upar", width=ax_width, height=ax_height)
plot_1d(z.grid, moments.charged.upar[:,1,1]; ax=ax, label="ion")
plot_1d(z.grid, moments.neutral.uz[:,1,1]; ax=ax, label="neutral")
if composition.n_neutral_species > 0
plot_1d(z.grid, moments.neutral.uz[:,1,1]; ax=ax, label="neutral")
end
#axislegend(ax)

irow += 1
layout = fig[irow,1] = GridLayout()
ax = Axis(layout[1,1], xlabel="z", ylabel="ppar", width=ax_width, height=ax_height)
plot_1d(z.grid, moments.charged.ppar[:,1,1]; ax=ax, label="ion")
plot_1d(z.grid, moments.neutral.pz[:,1,1]; ax=ax, label="neutral")
if composition.n_neutral_species > 0
plot_1d(z.grid, moments.neutral.pz[:,1,1]; ax=ax, label="neutral")
end
#axislegend(ax)
ax = Axis(layout[1,2], xlabel="z", ylabel="vth", width=ax_width, height=ax_height)
plot_1d(z.grid, moments.charged.vth[:,1,1]; ax=ax, label="ion")
plot_1d(z.grid, moments.neutral.vth[:,1,1]; ax=ax, label="neutral")
if composition.n_neutral_species > 0
plot_1d(z.grid, moments.neutral.vth[:,1,1]; ax=ax, label="neutral")
end
#axislegend(ax)

irow += 1
layout = fig[irow,1] = GridLayout()
ax = Axis(layout[1,1], xlabel="z", ylabel="qpar", width=ax_width, height=ax_height)
plot_1d(z.grid, moments.charged.qpar[:,1,1]; ax=ax, label="ion")
plot_1d(z.grid, moments.neutral.qz[:,1,1]; ax=ax, label="neutral")
if composition.n_neutral_species > 0
plot_1d(z.grid, moments.neutral.qz[:,1,1]; ax=ax, label="neutral")
end
#axislegend(ax)

resize_to_layout!(fig)
Expand Down

0 comments on commit 3e1fdfc

Please sign in to comment.