# 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 #include <fei_trilinos_macros.hpp>
00013
00014 #ifdef HAVE_FEI_AZTECOO
00015
00016 #include <fei_macros.hpp>
00017 #include <fei_Solver.hpp>
00018 #include <fei_Logger.hpp>
00019
00020 #ifdef HAVE_FEI_TEUCHOS
00021 namespace Teuchos {
00022   class ParameterList;
00023 }
00024 #endif
00025
00026 class AztecOO;
00027 class Epetra_CrsMatrix;
00028
00029 #ifdef HAVE_FEI_ML
00030 #include <ml_include.h>
00031 #include <ml_epetra_preconditioner.h>
00032 #endif
00033
00036 class Solver_AztecOO : public fei::Solver, private fei::Logger {
00037  public:
00041   Solver_AztecOO();
00042
00045   virtual ~Solver_AztecOO();
00046
00061   int solve(fei::LinearSystem* linearSystem,
00062       fei::Matrix* preconditioningMatrix,
00063       int numParams,
00064       const char* const* solverParams,
00065       int& iterationsTaken,
00066       int& status);
00067
00084   int solve(fei::LinearSystem* linearSystem,
00085       fei::Matrix* preconditioningMatrix,
00086       const fei::ParameterSet& parameterSet,
00087       int& iterationsTaken,
00088       int& status);
00089
00090   AztecOO& getAztecOO();
00091
00092   Teuchos::ParameterList& get_ParameterList();
00093
00094   void setMaxIters(int maxits) {maxIters_ = maxits;}
00095   void setTolerance(double tol) {tolerance_ = tol;}
00096   void setUseTranspose(bool useTrans) {useTranspose_ = useTrans;}
00097
00098   void setUseML(bool useml);
00099
00100  private:
00101   int setup_ml_operator(AztecOO& azoo, Epetra_CrsMatrix* A);
00102
00103  private:
00104   AztecOO* azoo_;
00105   double tolerance_;
00106   int maxIters_;
00107   bool useTranspose_;
00108   Teuchos::ParameterList* paramlist_;
00109
00110   bool useML_;
00111 #ifdef HAVE_FEI_ML
00112   ML_Epetra::MultiLevelPreconditioner* ml_prec_;
00113   bool ml_defaults_set_;
00114   int *ml_aztec_options_;
00115   double *ml_aztec_params_;
00116 #endif
00117
00118   std::string name_;
00119   std::string dbgprefix_;
00120 }; //class Solver_AztecOO
00121
00122 #endif // HAVE_FEI_AZTECOO
00123
00124 #endif
```
Generated on Wed Apr 13 10:08:24 2011 for FEI by  1.6.3