[Trilinos-Users] bug in AnasaziBasicEigenProblem

Simone Deparis deparis at MIT.EDU
Fri Mar 17 13:21:46 MST 2006


Hi,

The shortest way to describe what happens is to give an example:

I have
MyProblem =
       Teuchos::rcp( new Anasazi::BasicEigenproblem<double, MV, OP>(A, 
M, ivec) );
Anasazi::LOBPCG<double, MV, OP> MySolver(MyProblem, MySort, MyOM, MyPL);

MyProblem->SetProblem();

I solve my Eigenproblem once and then replace the operator A and M:
MyProblem->SetA (B);
MyProblem->SetM (N);
MyProblem->SetProblem();

Now I solve again using MySolver, but ...

   template <class ScalarType, class MV, class OP>
   ReturnType BasicEigenproblem<ScalarType, MV, OP>::SetProblem()
   {
     //----------------------------------------------------------------
     // Sanity Checks
     //----------------------------------------------------------------
(...)
     // If there is an A, but no operator, we can set them equal.
     if (_AOp.get() && !_Op.get()) { _Op = _AOp; }
(...)
    }

and in
   template <class ScalarType, class MV, class OP>
   LOBPCG<ScalarType,MV,OP>::LOBPCG(const 
Teuchos::RefCountPtr<Eigenproblem<ScalarType,MV,OP> > &problem,
                                    const 
Teuchos::RefCountPtr<SortManager<ScalarType,MV,OP> > &sm,
                                    const 
Teuchos::RefCountPtr<OutputManager<ScalarType> > &om,
                                    Teuchos::ParameterList &pl
                                    ):
     _problem(problem),
     _sm(sm),
     _om(om),
     _pl(pl),
     _Op(_problem->GetOperator()), // <<<<<<<<<
     _MOp(_problem->GetM()),
     _Prec(_problem->GetPrec()),

Since in the constructor of MyProblem _Op, not _AOp, as been setted 
equal to A, my new defined operator B will never be used!

One way around is to use SetOperator instaed of SetA

Question: Why there are two operators, _AOp and _Op?

What do you think?

Simone



-- 
_____________________________________________________________________
                                     Simone Deparis
   .~.                               Mech Eng Dept - MIT
   /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