Skip to content

Non uniform coordinate spacing #399

Answered by c-white
kurtsansom asked this question in Q&A
Discussion options

You must be logged in to vote

The grid is always perfectly geometric in cell widths (i.e. differences in adjacent face-centered coordinates).

Let's say there are n cells with a ratio of r. Call the faces x0, ..., xn and the cell widths Δ0, ..., Δn-1. Then Δi = Δ0 ri and so xi = x0 + Δ0j=0i-1 rj. We also have the boundary conditions x0 = xmin and xn = xmax.

To see the connection to logarithmic spacing, suppose the faces were uniformly log-spaced: ℓ(xi) = ℓxmin + i ℓΔ for ℓΔ = (ℓxmax - ℓxmin) / n. Then xi = xmin Δi, and we have xi+1 / xi is a constant, Δ. In this case, though, we also have Δi = xi+1 - xi = xmin Δi (Δ - 1), and so Δi+1 / Δi is the constant Δ. That is, this is also geometric in cell widths with the ass…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@kurtsansom
Comment options

@c-white
Comment options

@felker
Comment options

@kurtsansom
Comment options

Answer selected by kurtsansom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants