[Trilinos-Users] anasazi: uncorverged eigs

Simone Deparis deparis at MIT.EDU
Sun Feb 19 21:09:35 MST 2006


>Hi Simone,
> 
> The eigenvectors are not actually constructed until convergence is obtained,
> so a little work needs to be done to return the unconverged ones to the
> user.  I can look into it.
> 
> Are you getting some to eigenpairs to converge, but not all the ones you
> requested?  Do you need all that you requested, or do you just want to look
> at the rest of the ones that haven't converged?  Does increasing the maximum
> number of iterations help, or are your iterations expensive?
> 
> Thanks,
> Heidi


Hi Heidi,

Actually none is converged. As a rough patch, I have introduced a loop
outside Anasazi where at each loop I ask for a better precision until
the solver breaks:
something like

   double localTol(1.), globalTol;
   int returnCode(Anasazi::Ok);
   globalTol = MyPL.get("Tol", 1.0e-6);
   while (returnCode == Anasazi::Ok) {

     cout << "Anasazi::LOBPCG::solve() with Tol = " << localTol << endl;

     MyPL.set( "Tol", localTol );

     // Initialize the Block Arnoldi solver
     Anasazi::LOBPCG<double, MV, OP> MySolver(MyProblem, MySort, MyOM, 
MyPL);

     // Solve the problem to the specified tolerances or length
     returnCode = MySolver.solve();

     // Check that the solver returned OK,
     if (returnCode != Anasazi::Ok) {
       cout << "Anasazi::LOBPCG::solve() returned with code : "<< returnCode
	   << endl;
       break;
     }
     // Retrieve eigenvalues
     Teuchos::RefCountPtr<std::vector<double> > evals =
MyProblem->GetEvals();
     for (i=0 ; i < M_nev; i++)
       (*eigvals)(i) = (*evals)[i];


     // Retrieve eigenvectors

     *evecs = *(MyProblem->GetEvecs());

     if (localTol == globalTol) break;
     else {
       localTol = localTol/10;
       if (localTol < globalTol) localTol = globalTol;
     }
   }

I agree this is not optimal, but its cost is minimal. Moreover between
one loop and the other, the Eigenvectors are kept, such that the old
iterations are not "lost".

This is maybe enough for my purposes. What do you thing about this approach?

Thank you
Simone


>On 2/15/06 12:13 PM, "Simone Deparis" <deparis at MIT.EDU> wrote:
> 
> 
>>Hello,
>>
>>I would like to tell Anasazi::LOBPCG to return also the Eigenvectors and
>>eigenvalues that did not converge (Even if I know that this could be
>>dangerous; actually I will run a Newton starting from the founded
>>eigenvalues).
>>I am trying to see where to change the code, but I fear I would add some
>>bug ... Somebody already did this? or, somebody have a small patch for this?
>>
>>Thank you
>>Simone




-- 
_____________________________________________________________________
                                     Simone Deparis
   .~.                               Mechanical Engineering Dept
   /V\   L   I   N   U   X           77 Mass Ave Room 3-264
  // \\  =================           Cambridge MA 02139
/(   )\                             USA
  ^^-^^
phone :  +1 617 452 3285  mailto:deparis at mit.edu
fax   :  +1 617 258 8559  http://www.mit.edu/~deparis
_____________________________________________________________________





More information about the Trilinos-Users mailing list