poisson problem with periodic boundary conditions

92 views
Skip to first unread message

Ryan Abernathey

unread,
Oct 5, 2013, 7:46:44 PM10/5/13
to pyamg...@googlegroups.com
Hello,

I am new to pyamg. I would like to solve a poisson problem with periodic boundary conditions (i.e. the domain wraps around in the x and y directions). I have tried building up the correct A matrix myself, but I am having trouble getting the solver to converge.

Can anyone advise me on the best way to approach this problem?

Thank you very much!

-Ryan Abernathey

Jacob Schroder

unread,
Oct 8, 2013, 12:21:44 AM10/8/13
to pyamg...@googlegroups.com
Hi Ryan,

If your Poisson problem is periodic in all directions, then the
constant vector will likely be in the nullspace of the matrix, i.e.,
you have a singular matrix, A. This would explain very slow
convergence. Essentially multigrid can't reduce error, if that error
e satisfies A*e = 0. To check this, see if
>>> A*numpy.ones((A.shape[0],0))
gives you a vector of essentially zero values. What to do, is to use
the callback parameter offered by pyamg.krylov.cg() or
smoothed_aggregation_solver.solve(). This parameter lets you apply a
user-defined function to the current solution guess every iteration.
Set callback to be a function that will project out the constant
vector every few iterations. Convergence should happen quickly.

Hope this helps,

Jacob
> --
> You received this message because you are subscribed to the Google Groups
> "pyamg-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pyamg-user+...@googlegroups.com.
> To post to this group, send email to pyamg...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pyamg-user.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages