python,numpy,scipy,fipy

The cell centers are located at z=0.5, 1.5, 2.5, ... so FiPy is doing it's best to find the nearest cells to z=0, 1, 2, ... Try var2D.setValue(var3D((x2D, y2D, zcut * ones(var2D.mesh.numberOfCells) + dx/2.), order=0)) ...