fei_Solver_AztecOO.hpp

00001 #ifndef _fei_Solver_AztecOO_h_
00002 #define _fei_Solver_AztecOO_h_
00003 
00004 /*--------------------------------------------------------------------*/
00005 /*    Copyright 2005 Sandia Corporation.                              */
00006 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00007 /*    non-exclusive license for use of this work by or on behalf      */
00008 /*    of the U.S. Government.  Export of this program may require     */
00009 /*    a license from the United States Government.                    */
00010 /*--------------------------------------------------------------------*/
00011 
00012 #ifdef HAVE_FEI_AZTECOO
00013 
00014 #include <fei_macros.hpp>
00015 #include <fei_Solver.hpp>
00016 #include <fei_Logger.hpp>
00017 
00018 #ifdef HAVE_FEI_TEUCHOS
00019 namespace Teuchos {
00020   class ParameterList;
00021 }
00022 #endif
00023 
00024 class AztecOO;
00025 
00026 #ifdef HAVE_FEI_ML
00027 #include <ml_include.h>
00028 #include <ml_epetra_preconditioner.h>
00029 #endif
00030 
00033 class Solver_AztecOO : public fei::Solver, private fei::Logger {
00034  public:
00038   Solver_AztecOO();
00039 
00042   virtual ~Solver_AztecOO();
00043 
00058   int solve(fei::LinearSystem* linearSystem,
00059       fei::Matrix* preconditioningMatrix,
00060       int numParams,
00061       const char* const* solverParams,
00062       int& iterationsTaken,
00063       int& status);
00064 
00081   int solve(fei::LinearSystem* linearSystem,
00082       fei::Matrix* preconditioningMatrix,
00083       const fei::ParameterSet& parameterSet,
00084       int& iterationsTaken,
00085       int& status);
00086 
00087   AztecOO& getAztecOO();
00088 
00089   Teuchos::ParameterList& get_ParameterList();
00090 
00091   void setMaxIters(int maxits) {maxIters_ = maxits;}
00092   void setTolerance(double tol) {tolerance_ = tol;}
00093   void setUseTranspose(bool useTrans) {useTranspose_ = useTrans;}
00094 
00095   void setUseML(bool useml);
00096 
00097  private:
00098   int setup_ml_operator(AztecOO& azoo, Epetra_CrsMatrix* A);
00099 
00100  private:
00101   AztecOO* azoo_;
00102   double tolerance_;
00103   int maxIters_;
00104   bool useTranspose_;
00105   Teuchos::ParameterList* paramlist_;
00106 
00107   bool useML_;
00108 #ifdef HAVE_FEI_ML
00109   ML_Epetra::MultiLevelPreconditioner* ml_prec_;
00110   bool ml_defaults_set_;
00111   int *ml_aztec_options_;
00112   double *ml_aztec_params_;
00113 #endif
00114 
00115   std::string name_;
00116   std::string dbgprefix_;
00117 }; //class Solver_AztecOO
00118 
00119 #endif // HAVE_FEI_AZTECOO
00120 
00121 #endif

Generated on Wed May 12 21:30:41 2010 for FEI by  doxygen 1.4.7