Hi,

Bicgstab is not guaranteed to converge especially when using a bad 
preconditioner. You are using Jacobi as preconditioner which is a simple 
but not very good preconditioner. As you can see from the error message, 
you performed 1959 bicgstab iterations. That's a lot and it probably 
indicates that there was a breakdown. The easy fix to your problem is to 
use gmres instead of bicgstab. Gmres is guaranteed to converge. The real 
fix is to use a better preconditioner. With a bad preconditioner, gmres 
will converge slowly. You should look in the literature what kind of 
preconditioner you should use.

Best,

Bruno

On Thursday, April 15, 2021 at 4:21:21 AM UTC-4 bunel...@gmail.com wrote:

>
> Hi, 
> I'm having a problem for some values of parameters in my code.
> I get an error "dealii::SolverControl::NoConvergence", almost instantly 
> after the start of the solving process. The status at the end is this :
>
> "Iterative method reported convergence failure in step 1959. The residual 
> in the last step was nan."
>
> Here is some details about my problem. 
>
> I'm solving this equation in phi :
> [image: Screenshot from 2021-04-15 10-03-35.png]
> with u and v, speeds that are calculated in another part of the code.
>
> Since it is a non linear problem in phi, i'm using a Newton method to 
> solve it.
> I have developped my Newton Method and calculated the part that I'm 
> assembling.
> [image: Screenshot from 2021-04-15 10-05-29.png]
> As you can see, it is a non symmetric problem because of the advection 
> term and as such, i'm using the Bicgstab solver like this :
>            
>         SolverControl                  
> solver_control(phi_system_rhs.size()*2,1e-10);
>         SolverBicgstab<Vector<double>> solver(solver_control);
>         PreconditionJacobi<>           preconditioner;
>
>         preconditioner.initialize(phi_system_matrix, 1.0);
>         solver.solve(phi_system_matrix, phi_update, phi_system_rhs, 
> preconditioner); 
>         phi_constraints.distribute(phi_update);
>
> Note that if I use a direct solver like this : 
>    
>         SparseDirectUMFPACK A_direct;
>         A_direct.initialize(phi_system_matrix);
>         A_direct.vmult(phi_update, phi_system_rhs); 
>
>         phi_constraints.distribute(phi_update);
>
> I don't get an error but it is of course much slower (and the newton 
> method painfully converge but I knew this was gonna be difficult).
>
>
> "The other situation where this error may occur is when your matrix is not 
> invertible (e.g., your matrix has a null-space), or if you try to apply the 
> wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric 
> or not positive definite). In these cases, the residual in the last 
> iteration is likely going to be large."
>
> This message at the end of the error made me wonder if I was choosing a 
> bad solver for this task and tried to find the Bicgstab recquirements. 
> Unfortunately, I was not able to find the recquirements for the Bicgstab in 
> the documentation. 
>
> I found this page 
> <https://www.dealii.org/current/doxygen/deal.II/classSolverBicgstab.html>that 
> tells me to go to the solver base for requirements but I could not find the 
> solverBase page with this information. 
>
> So could someone point me in the right direction and/or tell me if they 
> have an idea of why this solver is not converging in my case ?
>
> Thanks again for developing dealii that is very useful to my research.
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6550d9a8-ccbe-4d28-b24d-479b1488afa8n%40googlegroups.com.

Reply via email to