[petsc-users] On the usage of MatSetValuesBlocked

Pierre Jolivet pierre at joliv.et
Sat Nov 5 04:38:05 CDT 2022



> On 5 Nov 2022, at 10:31 AM, Edoardo alinovi <edoardo.alinovi at gmail.com> wrote:
> 
> 
> Matt, Barry,
> 
> Should I do any particular trick to solve block matrices in ksp? 
> 
> I am doing a silly 3x3 cavity test case and I am struggling to converge using CG+bjacobi.

This is far from the ideal preconditioner.
First, you should check that your assembly is correct and stick to PCLU.
Does the KSP report an error in this case?
Does the solution « look » acceptable?

Thanks,
Pierre

> It might be I have an error in the matrix, but just to be sure I am not missing something fundamental in the setup.
> 
> This is my log that shows how norm residual is far to be happy:
> 
> 10000 KSP unpreconditioned resid norm 2.273088479279e+03 true resid norm 2.273088479279e+03 ||r(i)||/||b|| 6.561841227018e+02
>  Reason =           -3
>  ERROR: KSP has not converged. Simulations stopped.
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
> [0]PETSC ERROR: KSPSolve has not converged, reason DIVERGED_ITS
> 
> Thank you
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221105/467245a0/attachment.html>


More information about the petsc-users mailing list