<div dir="ltr">Dear Jose,<div><br></div><div>It indeed works correctly when I set maxit after calling EPSSetUp.</div><div>Thanks!<br></div><div><br></div><div>Pieter</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 4, 2019 at 12:30 PM Jose E. Roman <<a href="mailto:jroman@dsic.upv.es">jroman@dsic.upv.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Oops, the intention was to set 5 as the default value, but it is set at EPSSetUp() so changing it before is useless. This is wrong behaviour. I will try to fix it tomorrow.<br>
Jose<br>
<br>
<br>
> El 4 abr 2019, a las 20:45, Pieter Ghysels via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> escribió:<br>
> <br>
> Hi,<br>
> <br>
> I'm trying to set the maximum number of iterations in a minres preconditioner for the lobpcg eigensolver from SLEPc.<br>
> Using KSPSetTolerances, I can change the minres tolerance, but not maxit (it's always 5).<br>
> <br>
> ierr = EPSCreate( PETSC_COMM_WORLD , &eps ) ; CHKERRQ( ierr ) ;<br>
> ...<br>
> <br>
> ST st;<br>
> KSP ksp;<br>
> PC pc;<br>
> ierr = EPSGetST( eps , &st ) ; CHKERRQ( ierr ) ;<br>
> ierr = STSetType( st, STPRECOND ) ; CHKERRQ( ierr ) ;<br>
> ierr = STGetKSP( st , &ksp ) ; CHKERRQ( ierr ) ;<br>
> ierr = KSPSetType( ksp , KSPMINRES ) ; CHKERRQ( ierr ) ;<br>
> ierr = KSPGetPC( ksp , &pc ) ; CHKERRQ( ierr ) ;<br>
> ierr = PCSetType( pc , PCNONE ) ; CHKERRQ( ierr ) ;<br>
> ierr = KSPSetTolerances<br>
> ( ksp , /*tol_prec*/ 1e-10 , PETSC_DEFAULT , PETSC_DEFAULT , /*maxit_prec*/ 7 ) ;<br>
> CHKERRQ( ierr ) ;<br>
> ierr = KSPSetFromOptions( ksp ) ; CHKERRQ( ierr ) ;<br>
> ierr = STSetFromOptions( st ) ; CHKERRQ( ierr ) ;<br>
> ierr = EPSSetFromOptions( eps ) ; CHKERRQ( ierr ) ;<br>
> <br>
> ...<br>
> ierr = EPSSetOperators( eps , mat , NULL ) ; CHKERRQ( ierr ) ;<br>
> <br>
> ierr = EPSSolve( eps ) ; CHKERRQ( ierr ) ;<br>
> <br>
> <br>
> <br>
> When I run with -eps_view, I see:<br>
> <br>
> ...<br>
> EPS Object: 4 MPI processes<br>
> type: lobpcg<br>
> ...<br>
> ST Object: 4 MPI processes<br>
> type: precond<br>
> shift: 0.<br>
> number of matrices: 1<br>
> KSP Object: (st_) 4 MPI processes<br>
> type: minres<br>
> maximum iterations=5, initial guess is zero<br>
> tolerances: relative=1e-10, absolute=1e-50, divergence=10000.<br>
> left preconditioning<br>
> using PRECONDITIONED norm type for convergence test<br>
> PC Object: (st_) 4 MPI processes<br>
> type: none<br>
> ...<br>
> <br>
<br>
</blockquote></div>