need help to solve 2D poisson equation using Fortran

need help to solve 2D poisson equation using Fortran

Post by zive » Thu, 10 Jul 2008 15:42:07


HI Dear ALL,

Could anybody be kindly enough to give me an instruction to solve this
2D poisson equation using Fortran language:

=R-x^2-y^2

Any comments will be greatly appreciated. Thanks.

Ziven
 
 
 

need help to solve 2D poisson equation using Fortran

Post by Jos R Berg » Thu, 10 Jul 2008 21:39:28


> =R-x^2-y^2> > > > Any comments will be greatly appreciated. Thanks.> > > > Ziven

I think the Poisson equation is better written as: (see Wiki)

\Delta \phi = f

or more explicitly in 2 coordinates:

(d/dx)^2 phi(x,y) + (d/dy)^2 phi(x,y) = f(x,y)

To solve it you can discretize and use plain conjugate gradient
as a solver, but you must pre-condition the Laplace operator to
get decent convergence! Use SSOR and keep the operator symmetric,
and you'll be fine. By realizing that the discretized Laplace is
proportional to:

1 + L + U

with L and U the lower and upper triangular part, you can then
use a left and right preconditioner like:

(1 + w*L)^-1 * (1 + L + U) * (1 + w*U)^-1

which is symmetric, has easy matrix-free evaluation, and after
playing with w will give you pretty good convergence.

-- Jos

PS: don't use the Octave example on the Wiki CG page. It
contains an error.. (use the algorithm written above it)

 
 
 

need help to solve 2D poisson equation using Fortran

Post by glen herrm » Sun, 20 Jul 2008 09:26:15


Numerical Recipes has a pretty good description of Poisson
solvers, including a variety of actual programs to use.
(Depending on how much work you want to do, and how fast
you need the solution.)

I would at least start there.

-- glen