[Dune] Problem with CG Solver

S. Swayamjyoti swayam.151 at gmail.com
Tue Nov 22 16:50:49 CET 2011


Please find below my solver, could some one please point out why the
residuals are not going to zero? Is it because of bad conditioning of the
matrix?

*template<class GV>
void P1Elements<GV>::solve_u_i()
{
   // make linear operator from A
    Dune::MatrixAdapter<Matrix,ScalarField,ScalarField>
op(ThomasFermiMatrix);

    // initialize preconditioner
    Dune::SeqILUn<Matrix,ScalarField,ScalarField> ilu2(ThomasFermiMatrix,
1, 0.92)

    // the inverse operator
    Dune::CGSolver<ScalarField> cg(op, ilu2, 1e-15, 5000, 2);
    Dune::InverseOperatorResult r1;

    // initialue u to some arbitrary value to avoid u being the exact
    // solution
    u1.resize(b1.N(), false);
    u1 = 0.0;

        b1 *= -1.0;
    // finally solve the system
    cg.apply(u1, b1, r1);
} *

On Sun, Nov 20, 2011 at 8:13 PM, S. Swayamjyoti <swayam.151 at gmail.com>wrote:

> Hi Dune,
>
> I am solving a Ax = b system with the dune CG solver. I somehow find that,
> the residual is very high (order of 10^38) & not zero! I run the solver
> with verbosity 2, & I find that the "defect" of the system is also non-zero
> & of very high order (~ 10^40).
>
> Can someone please tell me the reason?
>
> Regards,
> Swayam
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20111122/5b7d449c/attachment.htm>


More information about the Dune mailing list