How large is the matrix? You can save it to a file with the command line 
option -ksp_view_mat binary:binaryfilename this will create a file with the 
name binaryfilename and then load the matrix into Matlab using the the Matlab 
Script in $PETSC_DIR/share/petsc/matlab/PetscBinaryRead.m  and compute its 
eigenvalues and eigenvectors  to see what its null space is or just look at the 
matrix to see if something is missing in the matrix.

  Barry


On Oct 14, 2014, at 9:22 PM, Sharp Stone <thron...@gmail.com> wrote:

> Thank you for your replies.
> 
> I used the Dirichlet boundary condition, so I guess I may rule out the 
> boundary problems. 
> 
> 
> On Tue, Oct 14, 2014 at 4:40 PM, Barry Smith <bsm...@mcs.anl.gov> wrote:
> 
>   Is the matrix suppose to be singular for the problem you are solving? 
> Perhaps the boundary conditions are incomplete or wrong?
> 
>   Barry
> 
> On Oct 14, 2014, at 2:57 PM, Matthew Knepley <knep...@gmail.com> wrote:
> 
> > On Tue, Oct 14, 2014 at 2:52 PM, Sharp Stone <thron...@gmail.com> wrote:
> > Thank you for your replies.
> >
> > If I use -fp_trap, I still got the same type of errors as follows.
> >
> > [0]PETSC ERROR: VecValidValues() line 34 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/src/vec/vec/interface/rvector.c Vec 
> > entry at local location 0 is not-a-number or infinite at end of function: 
> > Parameter number 3
> >
> > If use -pc_type lu -ksp_type gmres options, I got the zero pivot error as 
> > you suspected... Is there a way that can solve this problem? Thank you very 
> > much!
> >
> >
> > You are trying to solve a singular system:
> >
> >   
> > https://www.khanacademy.org/math/precalculus/precalc-matrices/inverting_matrices/v/singular-matrices
> >
> > Its not even clear what a solution would mean. I suggest starting with a 
> > problem for which you know the answer.
> >
> >    Matt
> >
> > [0]PETSC ERROR: --------------------- Error Message 
> > --------------------------------------------------------------
> >
> > [0]PETSC ERROR: Zero pivot in LU factorization: 
> > http://www.mcs.anl.gov/petsc/documentation/faq.html#ZeroPivot
> >
> > [0]PETSC ERROR: Zero pivot row 52 value 0 tolerance 2.22045e-14
> >
> > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for 
> > trouble shooting.
> >
> > [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014
> >
> > [0]PETSC ERROR: ./pStreamer on a arch-darwin-cxx-debug named 
> > host206-47.physci.fit.edu by GPL Tue Oct 14 15:49:50 2014
> >
> > [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ 
> > --with-fc=gfortran --with-clanguage=cxx --download-fblaslapack 
> > --download-mpich
> >
> > [0]PETSC ERROR: #49 MatPivotCheck_none() line 622 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/include/petsc-private/matimpl.h
> >
> > [0]PETSC ERROR: #50 MatPivotCheck() line 641 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/include/petsc-private/matimpl.h
> >
> > [0]PETSC ERROR: #51 MatLUFactorNumeric_SeqAIJ_Inode() line 1713 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/src/mat/impls/aij/seq/inode.c
> >
> > [0]PETSC ERROR: #52 MatLUFactorNumeric() line 2894 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/src/mat/interface/matrix.c
> >
> > [0]PETSC ERROR: #53 PCSetUp_LU() line 152 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/impls/factor/lu/lu.c
> >
> > [0]PETSC ERROR: #54 PCSetUp() line 902 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/interface/precon.c
> >
> > [0]PETSC ERROR: #55 KSPSetUp() line 305 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c
> >
> >
> > [0]PETSC ERROR: #56 KSPSolve() line 417 in 
> > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c
> >
> >
> > On Tue, Oct 14, 2014 at 3:18 PM, Barry Smith <bsm...@mcs.anl.gov> wrote:
> >
> >   I am guessing that the local solver is ILU(0) and that the ILU(0) 
> > factorization is creating a NaN or Inf due to a zero pivot. What happens if 
> > you run with the command line option -fp_trap  ?
> >
> >    Also if this is a small problem you can run with -mat_view to have it 
> > display the factored matrix.
> >
> >   Barry
> >
> > On Oct 14, 2014, at 2:07 PM, Sharp Stone <thron...@gmail.com> wrote:
> >
> > > Dear all,
> > >
> > > I'm trying to solve a linear system with petsc ksp solver. But after I 
> > > called the kspsolve routine, I always got the "Vec entry at local 
> > > location 0 is not-a-number or infinite at end of function" errors below. 
> > > I checked the matrix and the vectors, and they are all numbers (and 
> > > zeros). Is this a bug or I miss something? Thank you very much in advance!
> > >
> > > [0]PETSC ERROR: --------------------- Error Message 
> > > --------------------------------------------------------------
> > >
> > > [0]PETSC ERROR: Floating point exception
> > >
> > > [0]PETSC ERROR: Vec entry at local location 0 is not-a-number or infinite 
> > > at end of function: Parameter number 3
> > >
> > > [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html 
> > > for trouble shooting.
> > >
> > > [0]PETSC ERROR: Petsc Release Version 3.5.2, Sep, 08, 2014
> > >
> > > [0]PETSC ERROR: ./pStreamer on a arch-darwin-cxx-debug named 
> > > host206-47.physci.fit.edu by GPL Tue Oct 14 14:58:05 2014
> > >
> > > [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ 
> > > --with-fc=gfortran --with-clanguage=cxx --download-fblaslapack 
> > > --download-mpich
> > >
> > > [0]PETSC ERROR: #12 VecValidValues() line 34 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/vec/vec/interface/rvector.c
> > >
> > > [0]PETSC ERROR: #13 PCApply() line 442 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/interface/precon.c
> > >
> > > [0]PETSC ERROR: #14 KSP_PCApply() line 230 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/include/petsc-private/kspimpl.h
> > >
> > > [0]PETSC ERROR: #15 KSPSolve_PREONLY() line 26 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/impls/preonly/preonly.c
> > >
> > > [0]PETSC ERROR: #16 KSPSolve() line 459 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c
> > >
> > > [0]PETSC ERROR: #17 PCApply_BJacobi_Singleblock() line 675 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/impls/bjacobi/bjacobi.c
> > >
> > > [0]PETSC ERROR: #18 PCApply() line 440 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/pc/interface/precon.c
> > >
> > > [0]PETSC ERROR: #19 KSP_PCApply() line 230 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/include/petsc-private/kspimpl.h
> > >
> > > [0]PETSC ERROR: #20 KSPInitialResidual() line 56 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itres.c
> > >
> > > [0]PETSC ERROR: #21 KSPSolve_BCGS() line 50 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/impls/bcgs/bcgs.c
> > >
> > >
> > > [0]PETSC ERROR: #22 KSPSolve() line 459 in 
> > > /Users/GPL/local/PETSc/petsc-3.5.2/src/ksp/ksp/interface/itfunc.c
> > >
> > >
> > > --
> > > Best regards,
> > >
> >
> >
> >
> >
> > --
> > Best regards,
> >
> > Feng
> >
> >
> >
> > --
> > What most experimenters take for granted before they begin their 
> > experiments is infinitely more interesting than any results to which their 
> > experiments lead.
> > -- Norbert Wiener
> 
> 
> 
> 
> -- 
> Best regards,
> 
> Feng

Reply via email to