How can I obtain the 3D numerical solution for the potential (or field) due to a point charge inside a cubic domain with periodic boundary conditions in all directions? I guess I can use NDSolveValue with first argument:
-Laplacian[u[x, y, z], {x, y, z}] == diracD
to represent Gauss' Law $\nabla^2 \phi(r)=-q\delta(r)/\epsilon_0$. The function diracD approximates a Dirac delta function, e.g.: $diracD(x,y,z,\epsilon)=(\epsilon/ \pi)/(x^2 + y^2+z^2 + \epsilon^2)$ with some small value for $\epsilon$. I probably need to also make use of PeriodicBoundaryCondition.

DSolve. This is an analytical entity and has no meaning for numerical work. Math people call it a distribution. You need to approximate it with a real function that NDSolve can understand. Like a very large spike at some location with a very area it sits on or something like this. – Nasser Oct 15 '23 at 20:31