Can somebody help me figure it out the solver options for the attached 
generalized eigenvalue problem?

A x = lambda B x

where A and B have the same null space, with 5 zero eigenvalues.

The only non indefinite eigenvalue should be 41.1892

The problem is Hermite semi-positive so automatically slepc should purify it, 
but to be sure I added

EPSSetPurify(eps, PETSC_TRUE);

I guess with my non-solver-options slepc is still trying to do the inverse of 
the full
B matrix with an LU decomposition and gets zero pivot.

This is what I get as a PETSC error Message

 [0]PETSC ERROR: --------------------- Error Message 
--------------------------------------------------------------
   [0]PETSC ERROR: Zero pivot in LU factorization: 
https://www.mcs.anl.gov/petsc/documentation/faq.html#zeropivot
   [0]PETSC ERROR: Bad LU factorization
   [0]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html for 
trouble shooting.
   [0]PETSC ERROR: Petsc Development GIT revision: v3.11.3-2263-gce77f2ed1a  
GIT Date: 2019-09-26 13:31:14 -0500
   [0]PETSC ERROR: Nitsche_ex4a on a arch-linux2-c-opt named linux-8biu by 
eaulisa Tue Jul  7 10:17:55 2020
   [0]PETSC ERROR: Configure options --with-debugging=0 --with-x=1 
COPTFLAGS="-O3 -march=native -mtune=native" CXXOPTFLAGS="-O3 -march=native 
-mtune=native" FOPTFLAGS="-O3 -march=native -mtune=native" --download-openmpi=1 
--download-fblaslapack=1 --download-hdf5=1 --download-metis=1 
--download-parmetis=1 --with-shared-libraries=1 --download-blacs=1 
--download-scalapack=1 --download-mumps=1 --download-suitesparse
   [0]PETSC ERROR: #1 MatLUFactor_SeqDense() line 633 in 
/home/eaulisa/software/petsc/src/mat/impls/dense/seq/dense.c
   [0]PETSC ERROR: #2 MatLUFactorNumeric_SeqDense() line 432 in 
/home/eaulisa/software/petsc/src/mat/impls/dense/seq/dense.c
   [0]PETSC ERROR: #3 MatLUFactorNumeric() line 3056 in 
/home/eaulisa/software/petsc/src/mat/interface/matrix.c
   [0]PETSC ERROR: #4 PCSetUp_LU() line 126 in 
/home/eaulisa/software/petsc/src/ksp/pc/impls/factor/lu/lu.c
   [0]PETSC ERROR: #5 PCSetUp() line 894 in 
/home/eaulisa/software/petsc/src/ksp/pc/interface/precon.c
   [0]PETSC ERROR: #6 KSPSetUp() line 377 in 
/home/eaulisa/software/petsc/src/ksp/ksp/interface/itfunc.c
   [0]PETSC ERROR: #7 STSetUp_Shift() line 119 in 
/home/eaulisa/software/slepc/src/sys/classes/st/impls/shift/shift.c
   [0]PETSC ERROR: #8 STSetUp() line 271 in 
/home/eaulisa/software/slepc/src/sys/classes/st/interface/stsolve.c
   [0]PETSC ERROR: #9 EPSSetUp() line 273 in 
/home/eaulisa/software/slepc/src/eps/interface/epssetup.c
   [0]PETSC ERROR: #10 EPSSolve() line 136 in 
/home/eaulisa/software/slepc/src/eps/interface/epssolve.c



Thanks
Eugenio




Eugenio Aulisa

Department of Mathematics and Statistics,
Texas Tech University
Lubbock TX, 79409-1042
room: 226
http://www.math.ttu.edu/~eaulisa/
phone: (806) 834-6684
fax: (806) 742-1112



#include "slepceps.h"

int main(int argc, char** args) {
 
  SlepcInitialize(&argc, &args, PETSC_NULL, PETSC_NULL);
 
  double a[6][6] = {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
    {0.0, 1.9247225877689356, -1.9247225877689356, -0.96236129388446778, 0.0, 0.96236129388446778 },
    {0.0, -1.9247225877689356, 1.9247225877689356, 0.96236129388446778, 0.0, -0.96236129388446778},
    {0.0, -0.96236129388446778, 0.96236129388446778, 0.48118064694223389, 0.0, -0.48118064694223389},
    {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
    {0.0, 0.96236129388446778, -0.96236129388446778, -0.48118064694223389, 0.0, 0.48118064694223389}
  };


  double b[6][6] = {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
    {0.0, 0.046728852764308028, -0.046728852764308028, -0.023364426382154014, 0.0, 0.023364426382154014},
    {0.0, -0.046728852764308028, 0.046728852764308028, 0.023364426382154014, 0.0, -0.023364426382154014 },
    {0.0, -0.023364426382154014, 0.023364426382154014, 0.011682213191077007, 0.0, -0.011682213191077007 },
    {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
    {0.0, 0.023364426382154014, -0.023364426382154014, -0.011682213191077007, 0.0, 0.011682213191077007 }
  };

  Mat A, B;
  EPS eps;

  MatCreateSeqDense(PETSC_COMM_SELF, 6, 6, NULL, &A);
  MatCreateSeqDense(PETSC_COMM_SELF, 6, 6, NULL, &B);

  for(int i = 0; i < 6 ; i++) {
    for(int j = 0; j < 6; j++) {
      MatSetValues(A, 1, &i, 1, &j, &a[i][j], INSERT_VALUES);
      MatSetValues(B, 1, &i, 1, &j, &b[i][j], INSERT_VALUES);
    }
  }

  MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);
  MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY);

  MatAssemblyBegin(B, MAT_FINAL_ASSEMBLY);
  MatAssemblyEnd(B, MAT_FINAL_ASSEMBLY);

  EPSCreate(PETSC_COMM_SELF, &eps);
  EPSSetOperators(eps, A, B);

  EPSSetWhichEigenpairs(eps, EPS_LARGEST_MAGNITUDE);
  EPSSetPurify(eps, PETSC_TRUE);
 
  EPSSetFromOptions(eps);
 
  EPSSolve(eps);
 
  EPSDestroy(&eps);
  MatDestroy(&A);
  MatDestroy(&B);

  return 1;
}

Reply via email to