in reply to 1d array into 3d


I dint properly understand the question. For whatever i have understood i am answering.

 Converting 3d to 1d:
 --------------------
 3d dimension is nx,ny,nz
 then for i,j,k
 1d_index = (k.nx.ny) + (j.nx) + i

 Converting back 1d to 3d:
 -------------------------
 k = 1d_index / (nx.ny)
 j = (1d_index - k.nx.ny) / nx
 i = 1d_index - k.nx.ny - j.nx

Hope it works!!!