# Multigrid with PBC

1. Mar 17, 2015

### kolmog

Hello,

When trying to solve Poisson equation with multigrid considering periodic boundary conditions (PBC) in all directions:
$$\nabla^2\phi=f$$
where$$f=-4\pi\rho$$
I know that the integral over the volume should be equal to zero. That is:
$$\int_VfdV=0$$Wich in the discrete case reads as$$\sum f dxdydz=0$$
As I said before, if we are dealing with periodic bounday conditions, then it imposes also a condition for the potential, as the potential near some of the walls of the simulation box is equal to the potential on the opposite side.

Should it exist another extra condition?

Thanks

2. Mar 17, 2015

### phyzguy

It's not clear to me what you are asking. A couple of questions:

(1) The condition that the volume integral of rho is equal to zero is not always true. Is this given as a condition in the problem you are trying to solve?

(2) Do you know how to discretize Poisson's equation on the grid? This is one condition that needs to be met. Given the discretized Poisson's equation, the given values of rho, and the boundary conditions, the problem is completely determined and can be solved.

3. Mar 18, 2015

### kolmog

Hello,

With respect to the first question, this is a condition that has to be fulfilled.

The equation is for sure discretized with a given approximation for the laplacian, the right hand side taking into account periodic boundary conditions.

What I was asking, is that, a priori, multigrid could involve some extra condition to find the solution. I think that with the discretization and the condition for the integral in the right hand side it was enough, but I wanted to be sure.

Thanks

4. Mar 18, 2015

### phyzguy

I'm still not sure we are in agreement. Simply the condition that the volume integral of rho is zero is not enough to solve the problem. You need to know the functional form of rho, i.e. how the charge is distributed. There are many possible charge distributions that have zero volume integrals.

Or, it occurs to me that you may be talking about a gravitation problem. In this case, rho is positive definite, and the condition that the volume integral is zero means that rho is zero everywhere. Which is it, an electrostatics problem or a gravitation problem?

5. Mar 18, 2015

### kolmog

I have a known charge distribution defined on a grid (it is an electrostatics problem). The integral of the right hand side is zero because the system is neutrally charged.

6. Mar 18, 2015

### phyzguy

OK. Then if the charge distribution is known, the problem is well determined and can be solved. Bear in mind that there will still be a constant of integration, meaning that you can always add a constant to phi without changing anything. Is this the additional condition you are looking for?