PlayaBelosSolver.hpp
00001
00002
00003
00004
00005 #ifndef PLAYA_BELOSSOLVER_HPP
00006 #define PLAYA_BELOSSOLVER_HPP
00007
00008 #include "PlayaDefs.hpp"
00009 #include "PlayaLinearSolverBaseDecl.hpp"
00010 #include "PlayaPreconditionerFactory.hpp"
00011 #include "PlayaHandleable.hpp"
00012 #include "PlayaPrintable.hpp"
00013 #include "PlayaBelosAdapter.hpp"
00014 #include "Teuchos_Describable.hpp"
00015 #include "BelosBlockGmresSolMgr.hpp"
00016 #include "BelosBlockCGSolMgr.hpp"
00017 #include "BelosGCRODRSolMgr.hpp"
00018 #include "BelosRCGSolMgr.hpp"
00019 #include "BelosTFQMRSolMgr.hpp"
00020 #include "BelosConfigDefs.hpp"
00021 #include "BelosLinearProblem.hpp"
00022
00023 #include "Teuchos_RefCountPtr.hpp"
00024 #include "Teuchos_ParameterList.hpp"
00025
00026
00027 namespace Playa
00028 {
00029 using namespace Teuchos;
00030
00034 class BelosSolver : public LinearSolverBase<double>,
00035 public Handleable<LinearSolverBase<double> >,
00036 public Printable,
00037 public Describable
00038 {
00039 public:
00041 BelosSolver(const Teuchos::ParameterList& params);
00042
00044 virtual ~BelosSolver(){;}
00045
00047 void setUserPrec(const PreconditionerFactory<double>& pf) {pf_=pf;}
00048
00052 void print(std::ostream& os) const
00053 {
00054 os << description() << std::endl;
00055 }
00057
00061 std::string description() const {return "BelosSolver";}
00063
00064
00065
00067 virtual SolverState<double> solve(const LinearOperator<double>& op,
00068 const Vector<double>& rhs,
00069 Vector<double>& soln) const ;
00070
00074 virtual RCP<LinearSolverBase<double> > getRcp()
00075 {return rcp(this);}
00077
00078
00079 protected:
00080
00081 private:
00082
00084 PreconditionerFactory<double> pf_;
00086 mutable RCP<Belos::SolverManager<double,Anasazi::SimpleMV, LinearOperator<double> > > solver_ ;
00088 mutable bool hasSolver_;
00089 };
00090
00091 }
00092
00093 #endif