Le jeu. 15 avr. 2021 à 11:57, bunel...@gmail.com <bunel.fe...@gmail.com> a
écrit :

> Hi,
>
> thank you very much for your answer.
> I have actually tried to solve using GMRES like this :
>
>     SolverControl
> solver_control(phi_system_rhs.size()*2,1e-10);
>     PreconditionJacobi<>           preconditioner;
>     preconditioner.initialize(phi_system_matrix, 1.0);
>     SolverGMRES<Vector <double>> solver(solver_control );
>     solver.solve(phi_system_matrix, phi_update, phi_system_rhs,
> preconditioner);
>
> and with this, I still get an error because the solver reached the max
> number of iteration and did not converge... :
>
> "Iterative method reported convergence failure in step 164354. The
> residual in the last step was 0.348567."
>

Let me rephrase what I said. Non-restarted GMRES is guaranteed to converge.
deal.II uses restarted gmres. You can increase the number of iterations
before a restart (see
https://dealii.org/developer/doxygen/deal.II/structSolverGMRES_1_1AdditionalData.html#ac385db0e8c853c02d828469d5a5bdcca
)

>
> Unfortunately, I did not find any literature on preconditioner for my
> specific system so I guess I am down to trying them all and seeing if one
> of them works...
>

If you have no idea which preconditioner to use, you can try a black-box
preconditioner, such as incomplete LU (ILU), algebraic multigrid (AMG), and
geometric multigrid (GMG). ILU and AMG require Trilinos or PETSc. For GMG,
there are a couple of tutorials you can look at.

Best,

Bruno


>
> Le jeudi 15 avril 2021 à 17:41:10 UTC+2, bruno.t...@gmail.com a écrit :
>
>> 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 a topic in the
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/dealii/ehsEIhSqksU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> dealii+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/dealii/2570a596-bc4c-401a-81e1-03ee929ef46fn%40googlegroups.com
> <https://groups.google.com/d/msgid/dealii/2570a596-bc4c-401a-81e1-03ee929ef46fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAGVt9eOv%3DxRwKi-m%3DN5eOXHYMw_EY-4LDoy%2B%3DfhVJ_0_TnUwQg%40mail.gmail.com.

Reply via email to