On Tue, 21 Jan 2014 18:43:31 +0100 Simone Pezzuto <[email protected]> wrote:
> 2014/1/21 Jan Blechta <[email protected]> > > > On Tue, 21 Jan 2014 17:18:54 +0000 > > "Garth N. Wells" <[email protected]> wrote: > > > > > On 2014-01-21 17:01, Nikolaus Rath wrote: > > > > Hello, > > > > > > > > I noticed that the neumann-poisson demo > > > > ( > > http://fenicsproject.org/documentation/dolfin/1.3.0/python/demo/documented/neumann-poisson/python/documentation.html > > ) > > > > fails when using a different solver, e.g. when replacing > > > > > > > > solve(a == L, w) > > > > > > > > with > > > > > > > > solve(a == L, w, > > > > solver_parameters = {'linear_solver': 'cg', > > > > 'preconditioner': 'ilu'}) > > > > > > > > > > This problem needs very careful treatment when using iterative > > > solvers. Simple block-box preconditioners and solvers will very > > > likely fail. > > > > AMG preconditioning based on operator > > > > (inner(grad(u), grad(v)) + c*d)*dx > > > > could perform well. This operator does not have a dense row like the > > original one. This is a strategy similar to demo_stokes-iterative. > > > > > In this case the preconditioner is singular (pure neumann), no it > cannot be used. > > As Garth was mentioning, this problem is delicate for iterative > solver, not only because > its indefiniteness, but because the Lagrangian constraint you're > imposing yields > a column (the last one) of the full matrix that belongs to the kernel > of the top-left block. > > Since the nullspace is at hands, I would provide it to the solver and > then use CG+AMG, The problem is not semidefinite but rather indefinite. Hence CG is not well-defined even with knowledge of nullspace. One should rather use another short-recurrence (i.e. for symmetric problems) method like MINRES or SYMMLQ. Jan > with Jacobi relaxation at coarser scale instead Gauss elimination (at > least with petsc boomeramg). > > Simone > > > > Jan > > > > > > > > Garth > > > > > > > The error that I'm getting with FEniCS 1.3 is: > > > > > > > > $ python demo_neumann-poisson.py > > > > Solving linear variational problem. > > > > Solving linear system of size 4226 x 4226 (PETSc Krylov > > > > solver). Traceback (most recent call last): > > > > File "demo_neumann-poisson.py", line 68, in <module> > > > > 'preconditioner': 'ilu'}) > > > > File > > > > > > "/home/nikratio/.local/FEniCS/lib/python2.7/site-packages/dolfin/fem/solving.py", > > > > line 268, in solve > > > > _solve_varproblem(*args, **kwargs) > > > > File > > > > > > "/home/nikratio/.local/FEniCS/lib/python2.7/site-packages/dolfin/fem/solving.py", > > > > line 297, in _solve_varproblem > > > > solver.solve() > > > > RuntimeError: > > > > > > > > *** > > > > > > ------------------------------------------------------------------------- > > > > *** DOLFIN encountered an error. If you are not able to resolve > > > > this issue > > > > *** using the information listed below, you can ask for help at > > > > *** > > > > *** [email protected] > > > > *** > > > > *** Remember to include the error message listed below and, if > > > > possible, > > > > *** include a *minimal* running example to reproduce the error. > > > > *** > > > > *** > > > > > > ------------------------------------------------------------------------- > > > > *** Error: Unable to solve linear system using PETSc Krylov > > > > solver. *** Reason: Solution failed to converge in 2 iterations > > > > (PETSc reason DIVERGED_INDEFINITE_PC, residual norm ||r|| = > > > > 1.541789e+19). *** Where: This error was encountered inside > > > > PETScKrylovSolver.cpp. *** Process: 0 > > > > *** > > > > *** DOLFIN version: 1.3.0 > > > > *** Git changeset: > > > > *** > > > > > > ------------------------------------------------------------------------- > > > > > > > > > > > > Bug or user error? > > > > > > > > > > > > Best, > > > > Nikolaus > > > > > > > > _______________________________________________ > > > > fenics mailing list > > > > [email protected] > > > > http://fenicsproject.org/mailman/listinfo/fenics > > > _______________________________________________ > > > fenics mailing list > > > [email protected] > > > http://fenicsproject.org/mailman/listinfo/fenics > > > > _______________________________________________ > > fenics mailing list > > [email protected] > > http://fenicsproject.org/mailman/listinfo/fenics > > _______________________________________________ fenics mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics
