Local vs Global domain cell indices #619
-
Hi everyone, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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. |
Beta Was this translation helpful? Give feedback.
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.