Skip to content

Commit

Permalink
Correct diagnostic L2 norm to have the previously missing sqrt().
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Hardman committed Oct 31, 2023
1 parent 3f6e4db commit 3a53caf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/post_processing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2044,8 +2044,9 @@ function plot_Maxwellian_diagnostic(ff, density, parallel_flow, thermal_speed, v
ff_norm = copy(time)
for is in 1:n_ion_species
for it in 1:ntime
@views ff_norm[it] = integrate_over_vspace( (ff[:,:,is,it] .- ff_Maxwellian[:,:,is,it]).^2 , vpa_local, 0, vpa_local_wgts, vperp_local, 0, vperp_local_wgts)
@views ff_norm[it] /= integrate_over_vspace(ff_ones[:,:,is,it], vpa_local, 0, vpa_local_wgts, vperp_local, 0, vperp_local_wgts)
@views num = integrate_over_vspace( (ff[:,:,is,it] .- ff_Maxwellian[:,:,is,it]).^2 , vpa_local, 0, vpa_local_wgts, vperp_local, 0, vperp_local_wgts)
@views denom = integrate_over_vspace(ff_ones[:,:,is,it], vpa_local, 0, vpa_local_wgts, vperp_local, 0, vperp_local_wgts)
ff_norm[it] = sqrt(num/denom)
end
iz0_string = string("_iz0", string(iz0))
ir0_string = string("_ir0", string(ir0))
Expand Down

0 comments on commit 3a53caf

Please sign in to comment.