[petsc-users] Matrix is missing diagonal entry

Andrew T Barker Andrew.Barker at Colorado.EDU
Thu Sep 1 09:36:23 CDT 2011


This has happened to me if I forget to call MatAssemblyBegin/End.  The entry will still print out in the MatView(), but it won't compute.

Might not be your problem, but worth a shot.

---- Original message ----
>Date: Wed, 31 Aug 2011 18:15:14 -0600
>From: petsc-users-bounces at mcs.anl.gov (on behalf of Rongliang Chen <rongliang.chan at gmail.com>)
>Subject: [petsc-users] Matrix is missing diagonal entry  
>To: PETSc Users mail list <petsc-users at mcs.anl.gov>
>
>   Hello,
>
>   I got the error message "Matrix is missing diagonal
>   entry 23548!" when I tried to run my code. I print
>   out the 23548th row and find that the 23548th
>   element of this row is one and the others are zero.
>   Can anyone tell me what's maybe the problem and how
>   to fix this? Thanks.
>
>   Best Regards,
>   Rongliang
>
>   /bin/bash: SHELL: readonly variable
>   /bin/bash: PATH: readonly variable
>   [255]PETSC ERROR: --------------------- Error
>   Message ------------------------------------
>   [255]PETSC ERROR: Object is in wrong state!
>   [255]PETSC ERROR: Matrix is missing diagonal entry
>   23548!
>   [255]PETSC ERROR:
>   ------------------------------------------------------------------------
>   [255]PETSC ERROR: Petsc Release Version 3.1.0, Patch
>   8, Thu Mar 17 13:37:48 CDT 2011
>   [255]PETSC ERROR: See docs/changes/index.html for
>   recent updates.
>   [255]PETSC ERROR: See docs/faq.html for hints about
>   trouble shooting.
>   [255]PETSC ERROR: See docs/index.html for manual
>   pages.
>   [255]PETSC ERROR:
>   ------------------------------------------------------------------------
>   [255]PETSC ERROR:
>   /home/rchen/soft/fixedmesh/Cannula/./joab on a
>   bgl-ibm-g named R02M1N0 by Unknown Wed Aug 31
>   17:36:32 2011
>   [255]PETSC ERROR: Libraries linked from
>   /home/rchen/soft/petsc-3.1-p8-nodebug/bgl-ibm-goto-O3_440d/lib
>
>   [255]PETSC ERROR:
>   ------------------------------------------------------------------------
>   [255]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ_ilu0()
>   line 1627 in src/mat/impls/aij/seq/aijfact.c
>   [255]PETSC ERROR: MatILUFactorSymbolic_SeqAIJ() line
>   1731 in src/mat/impls/aij/seq/aijfact.c
>   [255]PETSC ERROR: MatILUFactorSymbolic() line 5464
>   in src/mat/interface/matrix.c
>   [255]PETSC ERROR: PCSetUp_ILU() line 204 in
>   src/ksp/pc/impls/factor/ilu/ilu.c
>   [255]PETSC ERROR: PCSetUp() line 795 in
>   src/ksp/pc/interface/precon.c
>   [255]PETSC ERROR: KSPSetUp() line 237 in
>   src/ksp/ksp/interface/itfunc.c
>   [255]PETSC ERROR: PCSetUpOnBlocks_ASM() line 335 in
>   src/ksp/pc/impls/asm/asm.c
>   [255]PETSC ERROR: PCSetUpOnBlocks() line 828 in
>   src/ksp/pc/interface/precon.c
>   [255]PETSC ERROR: KSPSetUpOnBlocks() line 159 in
>   src/ksp/ksp/interface/itfunc.c
>   [255]PETSC ERROR: KSPSolve() line 354 in
>   src/ksp/ksp/interface/itfunc.c
>   [255]PETSC ERROR: SNES_KSPSolve() line 2944 in
>   src/snes/interface/snes.c
>   [255]PETSC ERROR: SNESSolve() line 2255 in
>   src/snes/interface/snes.c
>   [255]PETSC ERROR: TimeStep() line 1462 in
>   /home/rlchen/rlchen/soft/fixedmesh/code_changed/joab.c
>   [255]PETSC ERROR: SolveSteadyState() line 1362 in
>   /home/rlchen/rlchen/soft/fixedmesh/code_changed/joab.c
>   [255]PETSC ERROR: ComputefixedBoundary() line 505 in
>   /home/rlchen/rlchen/soft/fixedmesh/code_changed/joab.c
>   [255]PETSC ERROR: JoabCtxSolve() line 165 in
>   /home/rlchen/rlchen/soft/fixedmesh/code_changed/joab.c
>   [255]PETSC ERROR: main() line 107 in
>   /home/rlchen/rlchen/soft/fixedmesh/code_changed/joab.c
>   .....................


More information about the petsc-users mailing list