I am trying to do a vector plot of a given vector field for which I wrote following code
f[x_, y_, z_] := 1/Sqrt[x^2 + y^2 + z^2] + 1/Sqrt[(x - 1)^2 + y^2 + z^2] + 1/Sqrt[(x - 1)^2 + (y -1)^2 + z^2] + 1/Sqrt[x^2 + (y - 1)^2 + z^2] + 1/Sqrt[x^2 + y^2 + (z - 1)^2] + 1/Sqrt[(x - 1)^2 + y^2 + (z - 1)^2] + 1/Sqrt[(x - 1)^2 + (y - 1)^2 + (z - 1)^2] + 1/Sqrt[x^2 + (y - 1)^2 + (z - 1)^2]
VectorPlot3D[Grad[f[x, y, z], {x, y, z}], {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]
But I'm getting following output
Where am I making the mistake and I have also tried restarting the kernel?
Edit: I got around the problem by going through the method of tables. The code is:
f[x_, y_, z_] := 1/Sqrt[x^2 + y^2 + z^2] + 1/Sqrt[(x - 1)^2 + y^2 + z^2] + 1/Sqrt[(x - 1)^2 + (y -1)^2 + z^2] + 1/Sqrt[x^2 + (y - 1)^2 + z^2] + 1/Sqrt[x^2 + y^2 + (z - 1)^2] + 1/Sqrt[(x - 1)^2 + y^2 + (z - 1)^2] + 1/Sqrt[(x - 1)^2 + (y - 1)^2 + (z - 1)^2] + 1/Sqrt[x^2 + (y - 1)^2 + (z - 1)^2]
h = Grad[f[x, y, z], {x, y, z}];
vectors = Table[-h, {x, -0.13, 1.13, 0.05}, {y, -.13, 1.13, 0.05}, {z, -.13, 1.13, 0.05}];
ListVectorPlot3D[vectors, VectorScale -> {Small, 0.6, Automatic}, VectorColorFunction -> "Rainbow", PerformanceGoal -> "Quality"]