# Numerical solution to Poisson's equation with complicated boundaries

I want to solve the Poisson equation for the electrostatic potential on a rectangular grid (FDM) and I have an efficient multigrid solver for doing so.

However, I'm having trouble figuring out how to handle the boundary conditions. I would like to impose $\phi \rightarrow 0$ for $(x,y,z) \rightarrow \infty$ (isolated system). The only approach for this that I found is James' algorithm, as described in Hockney & Eastwood (1988):

1. Calculate $\phi$ inside the domain $\Omega$, using $\Delta \phi(\Omega) = -\frac \rho {\varepsilon_0}$ and $\phi(\partial \Omega) = 0$. (With my multigrid solver)
2. Calculate a fictional screening charge on $\partial \Omega$ that, superposing the real potential, produces $\phi(\partial \Omega) = 0$ by applying the Poisson operator to the boundary points: $\rho = -\varepsilon_0 \, \Delta \phi$
3. From this fictional charge distribution, calculate the correction due to which the problem is altered to the one in step 1 and use it to determine the right solution.

One can imagine a grounded conductor at $\partial \Omega$ on which the charge distribution in $\Omega$ induces surface charges on the conductor to get the system which motivates this approach.

It is stated that this method does not work with electrodes (of constant potential) within $\Omega$ and my test calculations seem to support that. I just don't understand how? Wouldn't the potential of the electrodes just equivalently induce surface charges?

Hockney & Eastwood further describe the "Capacity Matrix method".

If P grid points represent the electrodes on the finite difference grid, one first solves for the potential with no charge on these P points. A P-vector is formed with the potential missing on the electrodes and multiplied by the P-order capacity matrix to obtain the induced charge P-vector. Adding this to the original charge distribution and solving again gives the desired potential. (Source)

While this seems feasible, I don't understand how I would impose $\phi \rightarrow 0$ for $(x,y,z) \rightarrow \infty$ here. Combine it with James? How exactly?