[petsc-users] eigensolution error with slepc

Jose E. Roman jroman at dsic.upv.es
Mon Apr 4 11:30:46 CDT 2016


> El 4 abr 2016, a las 18:23, Manav Bhatia <bhatiamanav at gmail.com> escribió:
> 
> Thanks, Jose!
> 
> I am currently running 3.6.2, and will update to 3.6.3. 
> 
> Is there a recommended strategy to automatically switch from GHEP to GNHEP for some subset of problems? Or should I choose to run all my eigenprobelms with GNHEP? 
> 
> Regards,
> Manav

Well you could consider doing a trick like this:

    PetscPushErrorHandler(PetscIgnoreErrorHandler,NULL);
    ierr = EPSSolve(eps);
    PetscPopErrorHandler();
    if (ierr) {
       ierr = EPSSetProblemType(eps,EPS_GNHEP);CHKERRQ(ierr);
       ierr = EPSSolve(eps);CHKERRQ(ierr);
    }

But this is very ugly and does not discriminate one particular error from others. A (costly) alternative would be to compute a rough approximation of the leftmost eigenvalue of your K matrix to see if it is negative.

Jose



More information about the petsc-users mailing list