[petsc-users] How to get the eigenvectors in Slepc

Sonya Blade sonyablade2010 at hotmail.com
Sun Apr 14 10:11:56 CDT 2013


>If the eigenvector is complex then of course the eigenvalue is complex as well >(I assume your matrix is real non-symmetric). You have to get both the real and >imaginary parts of the eigenvalue.>http://www.grycap.upv.es/slepc/documentation/current/docs/manualpages/EPS/EPSGetEigenpair.html>An alternative is to do all the computation in complex arithmetic (configure --with-scalar-type=complex).>Jose
Hi Jose,
Probably you misunderstood my question my problem is: ierr = EPSGetEigenvalue(eps,i,&eigen_r,&eigen_i);CHKERRQ(ierr);returns all eigenvalues for each iteration where there is no imaginary parts (and set to zeros in eigen_i as expected).
I cross checked that with another algorithm which proves that all the eigenvalues are correct (no imaginary parts),but glitch is with trying to fetch the eigenvectors. Eigenvectors obtained from the code below are mostly filled with zeros and only the 11th row(Slepc returns 11 eigenvalue) has real and imaginary part which is not possible.
  for (j=0;j<test_int;j++)
  {
   ierr = EPSGetEigenvector(eps,j,&vec[0],&vec1[0]);CHKERRQ(ierr);
    PetscPrintf(MPI_COMM_WORLD," %d || %4.8f || %4.8f \n",j,vec[j],vec1[j]);
  }  I also provide you the main code and required files.
Your help will be appreciated,
Regards, 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130414/d4c2c785/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.c
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130414/d4c2c785/attachment-0001.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IN.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130414/d4c2c785/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mass.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130414/d4c2c785/attachment-0003.txt>


More information about the petsc-users mailing list