corrected diffusion to work correctly (grid with boundary conditions defines torus)