Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef PLAYA_AZTECSOLVER_HPP
00043 #define PLAYA_AZTECSOLVER_HPP
00044
00045 #include "PlayaDefs.hpp"
00046 #include "PlayaLinearSolverBaseDecl.hpp"
00047 #include "PlayaHandleable.hpp"
00048 #include "PlayaPrintable.hpp"
00049 #include "Teuchos_Describable.hpp"
00050
00051 #include "Teuchos_Array.hpp"
00052 #include "Teuchos_RefCountPtr.hpp"
00053 #include "Teuchos_ParameterList.hpp"
00054 #include <map>
00055
00056 #include "AztecOO.h"
00057
00058 #define AZ_recursive_iterate 10001
00059
00060 #define HAVE_ML
00061
00062
00063 namespace Playa
00064 {
00065 using namespace Teuchos;
00066
00067
00068
00069
00070 class AztecSolver : public LinearSolverBase<double>,
00071 public Playa::Handleable<LinearSolverBase<double> >,
00072 public Printable,
00073 public Describable
00074 {
00075 public:
00076
00077 AztecSolver(const Teuchos::map<int, int>& aztecOptions,
00078 const Teuchos::map<int, double>& aztecParameters);
00079
00080
00081 AztecSolver(const Teuchos::ParameterList& params);
00082
00083
00084 virtual ~AztecSolver(){;}
00085
00086
00087 virtual void updateTolerance(const double& tol);
00088
00089
00090
00091 void setUserPrec(const LinearOperator<double>& P,
00092 const LinearSolver<double>& pSolver);
00093
00094
00095
00096
00097 void print(std::ostream& os) const
00098 {
00099 os << description() << std::endl;
00100 }
00101
00102
00103
00104
00105
00106 std::string description() const {return "AztecSolver";}
00107
00108
00109
00110
00111
00112 virtual SolverState<double> solve(const LinearOperator<double>& op,
00113 const Vector<double>& rhs,
00114 Vector<double>& soln) const ;
00115
00116
00117
00118
00119 virtual RCP<LinearSolverBase<double> > getRcp()
00120 {return rcp(this);}
00121
00122
00123
00124 protected:
00125
00126 private:
00127
00128 void setupML(Epetra_RowMatrix* A) const ;
00129
00130
00131 mutable Array<int> options_;
00132
00133
00134 mutable Array<double> parameters_;
00135
00136
00137 bool useML_;
00138
00139
00140 bool useIfpack_;
00141
00142
00143 bool useUserPrec_;
00144
00145
00146
00147 bool aztec_recursive_iterate_;
00148
00149
00150 mutable ParameterList precParams_;
00151
00152
00153 mutable RCP<Epetra_Operator> userPrec_;
00154
00155
00156 mutable Array<double> aztec_status;
00157
00158
00159 mutable Array<int> aztec_proc_config;
00160
00161
00162
00163 static Teuchos::map<string,int>& paramMap()
00164 {static Teuchos::map<string,int> rtn; return rtn;}
00165
00166
00167 static void initParamMap();
00168
00169
00170 };
00171
00172 }
00173
00174 #endif