Zero pivot in LU factorization

Dear FreeFEM community,

I‘m new to Freefem and I have been trying to conduct a resolvent analysis with incompressible flow. When I use the KSPSolve to get the inverse matrix, I met a problem

[0]PETSC ERROR: Zero pivot in LU factorization: 

[0]PETSC ERROR: Zero pivot row 12 value 0. tolerance 2.22045e-14

Now I have no idea to resolve this problem. Is there something wrong with my code or matrix construction? I have attached my code and a test case of NACA0012.

test.zip (463.7 KB)
Best,
Lao

Try -pc_factor_mat_solver_type mumps as an additional option.

I get the same error after I add the additional option.

=== Solving for omega = 5.000000000000e-01 ===

  **Warning: set default solver to UMFPACK

  -- discontinuous Galerkin  =0 size of Mat =0 Bytes

  --  int    (nQP: 7 ) in  Optimized = 1,  all

  -- CPU init assemble mat 2.099999999994e-05 s

  -- CPU assemble mat 3.052290000000e-01 s

  -- discontinuous Galerkin  =0 size of Mat =1583028 Bytes

  --  int    (nQP: 7 ) in  Optimized = 1,  all

  -- CPU init assemble mat 1.600000000002e-05 s

  -- CPU assemble mat 5.736000000000e-02 s

Warning: -- Your set of boundary condition is incompatible with the mesh label.

Warning: -- Your set of boundary condition is incompatible with the mesh label.

    ~HashMatrix:   Mean collision in hash: 1.391862640375e+00 0x600003d04000 rank: 0 matmul 0.000000000000e+00s

[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------

[0]PETSC ERROR: Zero pivot in LU factorization: 


[0]PETSC ERROR: Zero pivot row 12 value 0. tolerance 2.22045e-14

Does this error occur because I constructed a singular matrix? If the matrix is singular, does it mean that I constructed the wrong matrix or that I can’t compute my problem that way.