[Dune] Residual != 0

Christian Engwer christian.engwer at uni-muenster.de
Wed Oct 19 11:09:18 CEST 2011


Hi Alex,

> Hi, I set the verbosity level to true & I see that it calculates till pow
> (10, -15). But, when i calculate the residual as A*x - b, I do not get
> residual as 0. Could some one please help?

ISTL is using a defect formulation for the iterative solvers. If your
system is badly conditioned the real defect and the updated defect can
differ significantly.

> RESULTS:
> 
> E (w lagrange & self)    E (w/o self)                  E_lagrange
>        ||gradL||                   ||gradLphi||
> phi[atom_node]        *Residual_phi_i*
> === CGSolver
>    16  1.212512273e-15

please run again with verbosity=2

> === rate=0.1056936409, T=0, TIT=0, IT=16

what are the number below?

> 55.13802707            -24.07287785            -2.788880238e-13
> 17.45594764            0.08484197512            -7.936744468
> *9.99848961
> *

Cheers
Christian



> 
> SOLVER:
> 
> *template<class GV>
> void P1Elements<GV>::solve()
> {
>  *  // make linear operator from A*
>     Dune::MatrixAdapter<Matrix,ScalarField,ScalarField> op(PoissonMatrix);
> *
>     // initialize preconditioner*
>     Dune::SeqILUn<Matrix,ScalarField,ScalarField> ilu1(PoissonMatrix, 1,
> 0.92);
> *
>     // the inverse operator*
>     Dune::BiCGSTABSolver<ScalarField> bcgs(op, ilu1, 1e-15, 5000, 0);
>     Dune::InverseOperatorResult r;
> 
> *    // initialue u to some arbitrary value to avoid u being the exact
>     // solution*
>     u.resize(b.N(), false);
>     u = 2.0;
> 
>         b *= -1.0;
>     // finally solve the system
>     bcgs.apply(u, b, r);
> 
>     //    A.solve(u,b);*

> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune





More information about the Dune mailing list