# KSP\_DIVERGED\_NAN error

**URL:** <https://community.freefem.org/t/ksp-diverged-nan-error/2089>\
**Category:** General Discussion\
**Created:** [October 26, 2022, 1:53pm UTC](https://community.freefem.org/t/ksp-diverged-nan-error/2089 "2022-10-26T13:53:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajahstephen](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@ajahstephen](https://community.freefem.org/u/ajahstephen)\
**Post date:** [October 26, 2022, 1:53pm UTC](https://community.freefem.org/t/ksp-diverged-nan-error/2089/1 "2022-10-26T13:53:59Z")

</div>

I am trying a simulation in Fluidity/ICFERST for 3D geometry generated from Gmsh. It is giving me these error messages

WARNING: Failed to converge.  
PETSc did not converge for matrix solve of: DeltaP  
Reason for non-convergence: KSP\_DIVERGED\_NAN  
Number of iterations: 0  
Specified ignore\_all\_solver\_failures, therefore continuing  
Dumping matrix equation in file called matrixdump.

When I ran it in 2D, it ran successfully without any problem. Does anyone know the solution to this error please?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [October 26, 2022, 3:33pm UTC](https://community.freefem.org/t/ksp-diverged-nan-error/2089/2 "2022-10-26T15:33:55Z")

</div>

This is a FreeFEM board, PETSc-specific questions should be sent to either [petsc-users@mcs.anl.gov](mailto:petsc-users@mcs.anl.gov) or [petsc-maint@mcs.anl.gov](mailto:petsc-maint@mcs.anl.gov). Thank you for understanding.
