Hello everyone, I am trying to solve the Poisson equation using SNES class. I am running into a problem where PETSc complains that an object is in wrong state. I opened the matrix object in matlab to see if any diagonal entry is missing but I see that it is not the case. Could you please let me know what I am missing here? The complete error is as follows:
[0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Object is in wrong state [0]PETSC ERROR: Matrix is missing diagonal entry 0 [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019 [0]PETSC ERROR: ./a.out on a linux-gnu-c-debug named cg17-9.agave.rc.asu.edu by pbaikadi Wed Oct 14 11:33:45 2020 [0]PETSC ERROR: Configure options [0]PETSC ERROR: #1 MatILUFactorSymbolic_SeqAIJ() line 1687 in /packages/7x/petsc/3.11.1/petsc-3.11.1/src/mat/impls/aij/seq/aijfact.c [0]PETSC ERROR: #2 MatILUFactorSymbolic() line 6737 in /packages/7x/petsc/3.11.1/petsc-3.11.1/src/mat/interface/matrix.c [0]PETSC ERROR: #3 PCSetUp_ILU() line 144 in /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/pc/impls/factor/ilu/ilu.c [0]PETSC ERROR: #4 PCSetUp() line 932 in /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/pc/interface/precon.c [0]PETSC ERROR: #5 KSPSetUp() line 391 in /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: #6 KSPSolve() line 725 in /packages/7x/petsc/3.11.1/petsc-3.11.1/src/ksp/ksp/interface/itfunc.c [0]PETSC ERROR: #7 SNESSolve_NEWTONLS() line 225 in /packages/7x/petsc/3.11.1/petsc-3.11.1/src/snes/impls/ls/ls.c [0]PETSC ERROR: #8 SNESSolve() line 4560 in /packages/7x/petsc/3.11.1/petsc-3.11.1/src/snes/interface/snes.c [0]PETSC ERROR: #9 User provided function() line 0 in User file On a different note, I have two more questions. 1) When a matrix is being filled using MatSetValues, does the nnz vector also have a 0-based indexing? 2) If I explicitly have nnz 1-based indexing, then does nnz(i) indicate the number of nonzeros in the (i-1)^th row or the i^th row? Thank you in advance for your help. Best Regards, Pranay. ᐧ
