Do not parallelize 1D and 2D contributions into 3D, time is negligible

Set chunksize to N*N.
Remove pool.terminate() and pool.close() to avoid pool overhead; explicitly
delete dcf array to avoid memory exhaustion.
Do not let compute_3d_grid return grid, it is not always used

Moreover itertools.product is much faster.
Minor changes
Use cmath.pi instead of np.pi everywhere for consistency