Skip to content

Local vs Global domain cell indices #619

Answered by tomidakn
rajkjoshi7 asked this question in Q&A
Discussion options

You must be logged in to vote

You can use MeshBlock's LogicalLocation (pmb->loc), which contains (lx1, lx2, lx3, level). If lx1 is N, it means the MeshBlock is N-th block in the x1 direction on that level. So, if your MeshBlock size is (nbx1, nbx2, nbx3), (i,j,k) cell's global index on its level can be calculated as (lx1*nbx1+i, lx2*nbx2+j, lx3*nbx3+k). Note that you may need to adjust the indices according to ghost cells.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rajkjoshi7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants