Skip to content

Commit

Permalink
normalization in energy() docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Nov 22, 2020
1 parent b165e17 commit 5b270f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/barotropicqg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ set_U!(prob, U::Float64) = set_U!(prob.sol, prob.vars, prob.params, prob.grid, U
energy(prob)
energy(sol, grid)
Returns the domain-averaged kinetic energy of solution `sol`: ∫ ½ (u²+v²) dxdy / (Lx Ly) = ∑ ½ k² |ψ̂|².
Returns the domain-averaged kinetic energy of solution `sol`: ∫ ½ (u²+v²) dxdy / (Lx Ly) = ∑ ½ k² |ψ̂|² / (Lx Ly).
"""
energy(sol, grid) = parsevalsum2(sqrt.(grid.Krsq) .* grid.invKrsq .* sol, grid) / (2 * grid.Lx * grid.Ly)
energy(prob) = energy(prob.sol, prob.grid)
Expand Down

1 comment on commit 5b270f6

@liasiegelman
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@navidcy looks good to me (is there a more formal way to review this PR?)

Please sign in to comment.