22 #ifdef LIBMESH_TRILINOS_HAVE_AZTECOO 60 this->_solver_type =
GMRES;
62 if (this->n_processors() == 1)
79 _linear_solver =
new AztecOO();
83 switch(this->_preconditioner_type)
86 _linear_solver->SetAztecOption(AZ_precond,AZ_dom_decomp);
87 _linear_solver->SetAztecOption(AZ_subdomain_solve,AZ_ilu);
91 _linear_solver->SetAztecOption(AZ_precond,AZ_Jacobi);
95 _linear_solver->SetAztecOption(AZ_precond,AZ_dom_decomp);
96 _linear_solver->SetAztecOption(AZ_subdomain_solve,AZ_icc);
100 _linear_solver->SetAztecOption(AZ_precond,AZ_dom_decomp);
101 _linear_solver->SetAztecOption(AZ_subdomain_solve,AZ_lu);
105 _linear_solver->SetAztecOption(AZ_precond,AZ_dom_decomp);
106 _linear_solver->SetAztecOption(AZ_subdomain_solve,AZ_ilu);
114 template <
typename T>
115 std::pair<unsigned int, Real>
121 const unsigned int m_its)
123 LOG_SCOPE(
"solve()",
"AztecLinearSolver");
128 EpetraVector<T> * solution = cast_ptr<EpetraVector<T> *>(&solution_in);
139 _linear_solver->SetAztecOption(AZ_max_iter,m_its);
140 _linear_solver->SetAztecParam(AZ_tol,tol);
142 Epetra_FECrsMatrix * emat = matrix->
mat();
143 Epetra_Vector * esol = solution->vec();
144 Epetra_Vector * erhs = rhs->vec();
146 _linear_solver->Iterate(emat, esol, erhs, m_its, tol);
149 return std::make_pair(_linear_solver->NumIters(), _linear_solver->TrueResidual());
154 template <
typename T>
155 std::pair<unsigned int, Real>
162 libmesh_not_implemented();
167 template <
typename T>
168 std::pair<unsigned int, Real>
176 libmesh_not_implemented();
181 template <
typename T>
184 libmesh_not_implemented();
190 template <
typename T>
193 return _linear_solver->TrueResidual();
198 template <
typename T>
201 const double *
status = _linear_solver->GetAztecStatus();
203 switch (static_cast<int>(
status[AZ_why]))
209 libMesh::out <<
"AztecOO failed to converge within maximum iterations.\n";
212 libMesh::out <<
"AztecOO failed to support a user-requested parameter.\n";
215 libMesh::out <<
"AztecOO encountered numerical breakdown.\n";
218 libMesh::out <<
"AztecOO encountered numerical loss of precision.\n";
221 libMesh::out <<
"AztecOO encountered an ill-conditioned GMRES Hessian.\n";
224 libMesh::out <<
"AztecOO reported an unrecognized condition.\n";
231 template <
typename T>
234 const double *
status = _linear_solver->GetAztecStatus();
236 switch (static_cast<int>(
status[AZ_why]))
250 template <
typename T>
253 switch (this->_solver_type)
256 _linear_solver->SetAztecOption(AZ_solver, AZ_cg);
return;
259 _linear_solver->SetAztecOption(AZ_solver, AZ_cgs);
return;
262 _linear_solver->SetAztecOption(AZ_solver, AZ_tfqmr);
return;
265 _linear_solver->SetAztecOption(AZ_solver, AZ_bicgstab);
return;
268 _linear_solver->SetAztecOption(AZ_solver, AZ_gmres);
return;
273 <<
"Continuing with AztecOO defaults" << std::endl;
285 #endif // #ifdef LIBMESH_TRILINOS_HAVE_AZTECOO
void get_residual_history(std::vector< double > &hist)
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
processor_id_type n_processors() const
virtual void clear() override
void init(triangulateio &t)
AztecLinearSolver(const libMesh::Parallel::Communicator &comm)
OStreamProxy err(std::cerr)
virtual std::pair< unsigned int, Real > solve(SparseMatrix< T > &matrix_in, NumericVector< T > &solution_in, NumericVector< T > &rhs_in, const double tol, const unsigned int m_its) override
virtual void init(const char *name=nullptr) override
virtual void close() override
std::string enum_to_string(const T e)
virtual void print_converged_reason() const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
PreconditionerType _preconditioner_type
virtual LinearConvergenceReason get_converged_reason() const override
Epetra_FECrsMatrix * mat()
OStreamProxy out(std::cout)
Real get_initial_residual()