Three-dimensional distribution of the spin-polarized current inside nanostructures