[petsc-users] EPSGetConverge problem

Jose E. Roman jroman at dsic.upv.es
Fri Aug 24 04:43:08 CDT 2012


El 24/08/2012, a las 00:30, Eleni Siampli escribió:

>  Hello,
>  
> I am new to petsc and I am trying to calculate the eigenpairs.
> My code is like the following:
>  
> ierr = EPSCreate(PETSC_COMM_WORLD, &eps); CHKERRQ(ierr);
> ierr = EPSSetOperators(eps, S, D); CHKERRQ(ierr);
> ierr = EPSSetProblemType(eps, EPS_GHEP); CHKERRQ(ierr);
> 
> 
> PetscInt nev = 300;
> ierr = EPSSetDimensions(eps, nev, PETSC_DECIDE, PETSC_DECIDE); CHKERRQ(ierr);
> ierr = EPSSetWhichEigenpairs(eps, EPS_SMALLEST_MAGNITUDE);CHKERRQ(ierr);
> ierr = EPSSolve(eps); CHKERRQ(ierr);
> 
> ierr = EPSGetConverged(eps, &m_nconv);CHKERRQ(ierr);
>  
> What I don't understand is why m_conv is greater than nev.
> when I try to print the m_conv out:
> PetscPrintf(PETSC_COMM_WORLD," Number of converged eigenpairs: %D\n\n",m_nconv);
>  
> it gives me 399 instead of 300 (that I want).
>  
>  
> Thank you in advance,
>  
> Eleni

As stated in the users manual, the number of converged eigenpairs may be different from nev (otherwise we would not have a function EPSGetConverged).

If nconv>nev then you can just take the first nev solutions.

Are your problem matrices of order 399?

Jose



More information about the petsc-users mailing list