[petsc-dev] SLEPc General Eigenvalue Shift-Invert Crash

Jose E. Roman jroman at dsic.upv.es
Mon Dec 17 14:04:31 CST 2012


You should not use a target in combination with EPS_LARGEST_REAL. Instead, use EPS_TARGET_REAL or better a user-defined criterion as in ex18.c (note that EPSSetEigenvalueComparison is supported in Fortran but has not been well tested).

Another comment is that using a target as far as 10000 from the wanted eigenvalues is not a good idea, because the convergence criterion will likely give eigenvalues with high error (especially in the non-Hermitian case). You could try -eps_true_residual but sometimes this has the problem that convergence is not attained.

If the matrices are not too large, send them to slepc-maint and we will give them a try.

Jose


El 17/12/2012, a las 20:39, Miguel Arriaga escribió:

> Thanks for the reply,
> I had tried changing the target before but the problem is that the
> eigenvalues will change depending on my target. I'm using Fortran and
> my code looks like this:
>         call EPSCreate(PETSC_COMM_WORLD,eps,ierr)
>         (MatAssembly stuff here)
>         call EPSSetOperators(eps,Kmat,Mmat,ierr)
>         call EPSSetProblemType(eps,EPS_GNHEP,ierr)
>         call EPSSetWhichEigenpairs(eps,EPS_LARGEST_REAL,ierr)
>         call EPSSetTolerances(eps,tol,maxit,ierr)
>         call EPSSetDimensions(eps,nev,PETSC_DECIDE,PETSC_DECIDE,ierr)
>         call EPSSetFromOptions(eps,ierr)
>         call EPSSolve(eps,ierr)
> 
> Since I don't know where my eigenvalues will be (because they change
> as the material yields) I'm a little concerned with using target.
> Maybe I'm doing something wrong? I noticed that although I set
> EPS_LARGEST_REAL in my code, if I set it again in the command line it
> will change the output. Another thing is that I'm using Shift-Invert
> to look at a Largest Real problem, which although it seemed odd to me,
> it showed a much faster convergence.
> 
> Below I show some test results I obtained for just the first time step.
> 
> _Results:
> -I'm asking for 6 eigenvalues and I have a tol of 1E-5
> -Notice that the eigenvalues are different from the purely imaginary I
> got from Matlab and SLEPc without SInvert.
> 
> BASE = -st_type sinvert -st_ksp_type preonly -st_pc_type lu
> -st_pc_factor_mat_solver_package umfpack (has the mentioned error)
> 
> BASE -eps_target 0.2
> Global eig           0 Real  8.08057606271894713E-007 Im
> 0.0000000000000000
> Global eig           1 Real  5.88946613699903310E-010 Im
> 1.11478341210332509E-005
> Global eig           2 Real  5.88946613699903310E-010 Im
> -1.11478341210332509E-005
> Global eig           3 Real  1.00727620688800812E-010 Im
> 1.60248025360939258E-010
> Global eig           4 Real  1.00727620688800812E-010 Im
> -1.60248025360939258E-010
> Global eig           5 Real -2.82380008265192828E-010 Im
> 1.27051563295447506E-010
> Global eig           6 Real -2.82380008265192828E-010 Im
> -1.27051563295447506E-010
> Global eig           7 Real  -45.307348017077182      Im
> 0.0000000000000000
> 
> BASE -eps_target 1000
> Global eig           0 Real  1.33590310724684969E-006 Im
> 5.69992625689008225E-003
> Global eig           1 Real  1.33590310724684969E-006 Im
> -5.69992625689008225E-003
> Global eig           2 Real  -45.307261982302634      Im
> 0.0000000000000000
> Global eig           3 Real  -90.614531192221420      Im
> 0.0000000000000000
> Global eig           4 Real  -182.34960882354494      Im
> 0.0000000000000000
> Global eig           5 Real  -227.65688316119918      Im   0.0000000000000000
> 
> BASE -eps_target 10000
> Global eig           0 Real  0.43857832608046010      Im
> 0.0000000000000000
> Global eig           1 Real -0.44680019931001880      Im
> 0.0000000000000000
> Global eig           2 Real  -45.307619734525360      Im
> 0.0000000000000000
> Global eig           3 Real  -90.609456729185695      Im
> 0.0000000000000000
> Global eig           4 Real -1.23910373804392293E-003 Im
> 1842.6494652654314
> Global eig           5 Real -1.23910373804392293E-003 Im  -1842.6494652654314
> 
> BASE -eps_target 0.2 -eps_largest_real
> Global eig           0 Real  5.88925547218011047E-010 Im
> 1.11479604597693868E-005
> Global eig           1 Real  5.88925547218011047E-010 Im
> -1.11479604597693868E-005
> Global eig           2 Real  3.41273675985576119E-011 Im
> 2.48751366232282650E-011
> Global eig           3 Real  3.41273675985576119E-011 Im
> -2.48751366232282650E-011
> Global eig           4 Real  1.94852467494399662E-012 Im
> 5.58171840043041153E-011
> Global eig           5 Real  1.94852467494399662E-012 Im
> -5.58171840043041153E-011
> Global eig           6 Real -3.06560610230377506E-011 Im
> 2.38634932296064250E-011
> Global eig           7 Real -3.06560610230377506E-011 Im
> -2.38634932296064250E-011
> Global eig           8 Real -3.14280823587864688E-010 Im   0.0000000000000000
> 
> BASE -eps_target 1000 -eps_largest_real
> Global eig           0 Real  3.41060513164848089E-012 Im
> 1.32716666241605970E-005
> Global eig           1 Real  3.41060513164848089E-012 Im
> -1.32716666241605970E-005
> Global eig           2 Real -3.36171979142818600E-010 Im
> 1842.6504379364101
> Global eig           3 Real -3.36171979142818600E-010 Im
> -1842.6504379364101
> Global eig           4 Real -2.93482571578351781E-009 Im
> 2008.6622800422490
> Global eig           5 Real -2.93482571578351781E-009 Im  -2008.6622800422490
> 
> BASE -eps_target 10000 -eps_largest_real
> Global eig           0 Real  8.44766719455947168E-003 Im
> 0.23198091192374859
> Global eig           1 Real  8.44766719455947168E-003 Im
> -0.23198091192374859
> Global eig           2 Real  2.18278728425502777E-011 Im
> 1842.6504379364712
> Global eig           3 Real  2.18278728425502777E-011 Im
> -1842.6504379364712
> Global eig           4 Real -2.00088834390044212E-011 Im
> 2008.6622800484372
> Global eig           5 Real -2.00088834390044212E-011 Im  -2008.6622800484372
> 
> 
> Thank you in advance for your help,
> Miguel




More information about the petsc-dev mailing list