PlayaIterativeSolver.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 //   
00003 /* @HEADER@ */
00004 
00005 #ifndef PLAYA_ITERATIVESOLVER_HPP
00006 #define PLAYA_ITERATIVESOLVER_HPP
00007 
00008 #include "PlayaDefs.hpp"
00009 #include "PlayaLinearSolverBaseDecl.hpp"
00010 
00011 namespace Playa
00012 {
00013   using namespace Teuchos;
00014 
00015   /**
00016    *
00017    */
00018   template <class Scalar>
00019   class IterativeSolver : public LinearSolverBase<Scalar>
00020   {
00021   public:
00022     /** */
00023     IterativeSolver(const ParameterList& params = ParameterList());
00024 
00025     /** */
00026     virtual ~IterativeSolver(){;}
00027     
00028     /** */
00029     int getMaxiters() const 
00030     {return this->parameters().template get<int>(maxitersParam());}
00031 
00032     /** */
00033     Scalar getTol() const 
00034     {return this->parameters().template get<double>(tolParam());}
00035 
00036     /** Change the convergence tolerance. */
00037     virtual void updateTolerance(const double& tol)
00038     {getParameter<double>(this->parameters(), tolParam())=tol;}
00039 
00040     /** */
00041     static std::string maxitersParam() {return "Max Iterations";}
00042 
00043     /** */
00044     static std::string tolParam() {return "Tolerance";}
00045 
00046     /** */
00047     static int defaultMaxiters() {return 500;}
00048 
00049     /** */
00050     static Scalar defaultTol() {return 1.0e-10;}
00051   };
00052 
00053   
00054   template <class Scalar> inline
00055   IterativeSolver<Scalar>::IterativeSolver(const ParameterList& params)
00056     : LinearSolverBase<Scalar>(params)
00057   {;}
00058   
00059 }
00060 
00061 #endif

Site Contact