I have the data for 3D vector field $\vec{A}$ (with components $\vec{A_1}$, $\vec{A_2}$ and $\vec{A_3}$) sampled on a 3D grid with integer indices i, j and k.
Assuming that only the third component $\vec{A_3}$ is non-zero, I have the expression for the components of curl: $\vec{B} = \nabla \times \vec{A}$ as:
B1 = -(A3[i][j][k] - A3[i][j + 1][k] + A3[i + 1][j][k] - A3[i + 1][j + 1][k])/ (2 * dx[2])
B2 = (A3[i][j][k] + A3[i][j + 1][k] - A3[i + 1][j][k] - A3[i + 1][j +1][k]) / (2 * dx[1])
B3 = 0
How can the above definition be expanded for a vector $\vec{A}$ with all three components non-zero on a full 3D grid?
I have seen the answer (discrete definitions of curl $\nabla \times F$?) for a similar question on a 2D grid, but I am not sure how to expand it for a 3D grid.