RectilinearGrid
metrics are described wrong in the docstring
#3252
Labels
RectilinearGrid
metrics are described wrong in the docstring
#3252
There is a mismatch between what the docstring of the
RectilinearGrid
claims for what the metrics (e.g.,Δxᶜᵃᵃ
orΔxᶠᵃᵃ
) are and what the metrics actually correspond to.The docstring says that, e.g.,
Δxᶜᵃᵃ
is the distances between cell centers. I think this is wrong. First of all, this is not uniquely defined as, e.g., the distance between a cell center and the adjacent cell centers may be different on each side of the cell. I believe thatΔxᶜᵃᵃ
is, instead, the length of the corresponding cell that is centered atcaa
, or equivalently, is the distances between the adjacent faces of each cell's center. Note that for a regularly-spaced grid what I claim to be correct and what the docstring mentions are equivalent (and possibly this is what lead to the current docstring?). However, for a variably-spaced grid they are not equivalent. Here's an example:A schematic of the cell faces and centers together with the corresponding values for
Δx
is below:I am pretty sure that what we want is what the code actually does. In this case, what's left to be done is simply to fix the docstring. Am I right?
(P.S.: I stumbled upon this while trying to fill the halos properly for #3239.)
The text was updated successfully, but these errors were encountered: