# [petsc-users] 2-norm of solution update suddenly becomes zero after a few iterations

Matthew Knepley knepley at gmail.com
Sat Aug 22 07:24:44 CDT 2020

```On Sat, Aug 22, 2020 at 2:07 AM baikadi pranay <pranayreddy865 at gmail.com>
wrote:

> Hello,
>
> I am trying to solve the Poisson equation in 2D for heterostructure
> devices. I have linearized the equation and discretized it using FDM. I am
> using BiCGStab to iteratively solve for the solution as follows:
>
> Step 1: Solve A^(i-1) x^(i) = b^(i-1)     {i = 1 to N where convergence is
> reached}
> Step 2: Use x^{i} to update the central coefficients of A^{i-1} to get
> A^{i} and                          similarly  update b^{i-1} to get b^{i}
> Step3: If ( ||x^{i}-x^{i-1}||_2 , the 2-norm of the solution update, is
> greater than a                     tolerance, then go back to Step 1  to
> solve the new system of equations                     using BiCGStab. Else,
> exit the loop.
> *1) I am facing the following problem with this procedure*:
> The 2-norm of the solution update is suddenly becoming zero after a few
> iterations in some cases. I print out the getconvergedreason and there are
> not red flags there, so I am kind of confused whey this behaviour is being
> observed. This behaviour is leading to "false convergences", in the sense
> that the solutions obtained are not physical.
>
> A similar behaviour was observed when I used SOR instead of BiCGStab. At
> this point I am starting to suspect if it is wrong to use linear solvers on
> the poisson equation which is a nonlinear equation (although linearized).
> If you could please comment on this, that would be very helpful.
>
> Any help with this problem is greatly appreciated. Please let me know if
> you need any further information.
>

1) You are coding up the Picard method by hand to solve your nonlinear
equation. If the operator is not contractive, this can stagnate, as you are
seeing. You
could try another solver, like Newton's method. We have a variety of
nonlinear solves in the SNES class.

2) It is not clear from your description whether you linear solver is
converging. BiCGStab without a preconditioner is a terrible solver for
Poisson. We usually
recommend starting with Algebraic Multigrid, like Hypre which is great
at 2D Poisson. You can monitor the convergence of your linear solver using

-knp_monitor_true_solution -ksp_converged_reason

We want to see this information with any questions about convergence.

Thanks,

Matt

> Thank you,
>
> Sincerely,
> Pranay.
>
> ᐧ
>

--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their