BelosEpetraOperator.h

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 //
00004 //                 Belos: Block Linear Solvers Package
00005 //                 Copyright (2004) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 // @HEADER
00028 
00034 #ifndef BELOS_EPETRA_OPERATOR_H
00035 #define BELOS_EPETRA_OPERATOR_H
00036 
00037 #include "Epetra_MultiVector.h"
00038 #include "Epetra_Operator.h"
00039 #include "Epetra_Map.h"
00040 #include "Epetra_LocalMap.h"
00041 
00042 #include "BelosLinearProblem.hpp"
00043 #include "BelosStatusTest.hpp"
00044 #include "BelosOutputManager.hpp"
00045 #include "BelosEpetraAdapter.hpp"
00046 #include "BelosBlockGmresSolMgr.hpp"
00047 #include "BelosPseudoBlockGmresSolMgr.hpp"
00048 #include "BelosBlockCGSolMgr.hpp"
00049 
00050 #include "Teuchos_ParameterList.hpp"
00051 using Teuchos::RCP;
00052 using Teuchos::ParameterList;
00053 
00059 namespace Belos {
00060 
00062 //-------- class BelosEpetraOperator --------------------
00063 //
00064 // This class will allow Belos to be called as an Epetra_Operator.
00065 // Thus, it can use itself as a preconditioner if need be.  It can
00066 // also be used as the inner iteration of Anasazi :)
00067 //
00069 
00070 class EpetraOperator : public virtual Epetra_Operator {
00071 public:
00073 
00074   
00076   EpetraOperator( const RCP<LinearProblem<double,Epetra_MultiVector,Epetra_Operator> >& lp, 
00077       const RCP<ParameterList>& plist,
00078                   bool initSolnVec = false );
00079   
00081   virtual ~EpetraOperator() {}
00083   
00085 
00086   
00088   int SetUseTranspose( bool UseTranspose_in ) { return(-1); };
00090   
00092 
00093   
00095   int Apply( const Epetra_MultiVector &X, Epetra_MultiVector &Y ) const;
00096   
00098   int ApplyInverse( const Epetra_MultiVector &X, Epetra_MultiVector &Y ) const;
00100   
00102 
00103   
00105   double NormInf() const { return(0.0); };
00107   
00109 
00110   
00112   const char* Label() const { return(&Solver[0]); };
00113   
00115   bool UseTranspose() const { return(false); };
00116   
00118   bool HasNormInf() const { return(false); };
00119   
00121   const Epetra_Comm& Comm() const;
00122   
00124   const Epetra_Map& OperatorDomainMap() const;
00125   
00127   const Epetra_Map& OperatorRangeMap() const; 
00129 private:
00130 
00131   RCP<SolverManager<double,Epetra_MultiVector,Epetra_Operator> > solver_;
00132   RCP<LinearProblem<double,Epetra_MultiVector,Epetra_Operator> > lp_;
00133   RCP<ParameterList> plist_;
00134 
00135   std::vector<char> Solver;
00136   bool initSolnVec_;
00137 };
00138 
00139 } //end namespace Belos
00140 
00141 // end of file BELOS_EPETRA_OPERATOR_H
00142 #endif 
00143 

Generated on Wed May 12 21:45:50 2010 for Belos by  doxygen 1.4.7