The vortex-in-cell method for the study of three-dimensional vortex structures