This error appears when computing the B-norm of a vector x, as sqrt(x'*B*x). 
Probably your B matrix is semi-definite, and due to floating-point error the 
value x'*B*x becomes negative for a certain vector x. The code uses a tolerance 
of 10*PETSC_MACHINE_EPSILON, but it seems the rounding errors are larger in 
your case. Or maybe your B-matrix is indefinite, in which case you should solve 
the problem as non-symmetric (or as symmetric-indefinite GHIEP).

Do you get the same problem with the Krylov-Schur solver?

A workaround is to edit the source code and remove the check or increase the 
tolerance, but this may be catastrophic if your B is indefinite. A better 
solution is to reformulate the problem, solving the matrix pair (A,C) where 
C=alpha*A+beta*B is positive definite (note that then the eigenvalues become 
lambda/(beta+alpha*lambda)).

Jose

> El 7 feb 2020, a las 1:00, Emmanuel Ayala <[email protected]> escribió:
> 
> Hi everyone,
> 
> I'm solving the eigenvalue problem of three bodies in the same program, it 
> generates a three sets of matrices.
> 
> I installed PETSc as optimized version:
> 
> Configure options --with-debugging=0 COPTFLAGS="-O2 -march=native 
> -mtune=native" CXXOPTFLAGS="-O2 -march=native -mtune=native" FOPTFLAGS="-O2 
> -march=native -mtune=native" --download-mpich --download-superlu_dist 
> --download-metis --download-parmetis --download-cmake 
> --download-fblaslapack=1 --with-cxx-dialect=C++11
> 
> Then I installed SLEPc in the standard form and referring to PETSc optimized 
> directory. I did NOT install SLEPc with --with-debugging=0, because I'm still 
> testing my code.
> 
> My matrices comes from DMCreateMatrix, the stiffness matrix and mass matrix. 
> I use the function MatIsSymmetric to check if my matrices are symmetric or 
> not, and always the matrices are symmetric (even when the program crash). For 
> that reason I use:
> 
> ierr = EPSSetProblemType(eps,EPS_GHEP); CHKERRQ(ierr);
> ierr = EPSSetType(eps,EPSLOBPCG); CHKERRQ(ierr); // because I need the 
> smallest
> 
> The problem is: sometimes the code works well for the three sets of matrices 
> and I get the expected results, but sometimes it does not happen, it only 
> works for the first sets of matrices, and then it crashes, and when that 
> occurs the error message is:
> 
> [0]PETSC ERROR: --------------------- Error Message 
> --------------------------------------------------------------
> [0]PETSC ERROR: The inner product is not well defined: indefinite matrix
> [0]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html 
> <https://www.mcs.anl.gov/petsc/documentation/faq.html> for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.12.3, Jan, 03, 2020 
> [0]PETSC ERROR: ./comp on a linux-opt-02 named lnx by ayala Thu Feb  6 
> 17:20:16 2020
> [0]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O2 
> -march=native -mtune=native" CXXOPTFLAGS="-O2 -march=native -mtune=native" 
> FOPTFLAGS="-O2 -march=native -mtune=native" --download-mpich 
> --download-superlu_dist --download-metis --download-parmetis --download-cmake 
> --download-fblaslapack=1 --with-cxx-dialect=C++11
> [0]PETSC ERROR: #1 BV_SafeSqrt() line 130 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/include/slepc/private/bvimpl.h
> [0]PETSC ERROR: #2 BVNorm_Private() line 473 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/bv/interface/bvglobal.c
> [0]PETSC ERROR: #3 BVNormColumn() line 718 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/bv/interface/bvglobal.c
> [0]PETSC ERROR: #4 BV_NormVecOrColumn() line 26 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/bv/interface/bvorthog.c
> [0]PETSC ERROR: #5 BVOrthogonalizeCGS1() line 136 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/bv/interface/bvorthog.c
> [0]PETSC ERROR: #6 BVOrthogonalizeGS() line 188 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/bv/interface/bvorthog.c
> [0]PETSC ERROR: #7 BVOrthonormalizeColumn() line 416 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/src/sys/classes/bv/interface/bvorthog.c
> [0]PETSC ERROR: #8 EPSSolve_LOBPCG() line 144 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/src/eps/impls/cg/lobpcg/lobpcg.c
> [0]PETSC ERROR: #9 EPSSolve() line 149 in 
> /home/ayala/Documents/SLEPc/slepc-3.12.2/src/eps/interface/epssolve.c
> 
> Number of iterations of the method: 0
> Number of linear iterations of the method: 0
> Solution method: lobpcg
> 
> Number of requested eigenvalues: 6
> Stopping condition: tol=1e-06, maxit=10000
> Number of converged eigenpairs: 0
> 
> The problem appears even when I run the same compilation.
> 
> Anyone have any suggestions to solve the problem?
> 
> Kind regards.

Reply via email to