47 _preconditioner (nullptr),
48 same_preconditioner (false),
49 _solver_configuration(nullptr)
56 std::unique_ptr<LinearSolver<T>>
64 switch (solver_package)
66 #ifdef LIBMESH_HAVE_LASPACK 68 return libmesh_make_unique<LaspackLinearSolver<T>>(comm);
72 #ifdef LIBMESH_HAVE_PETSC 74 return libmesh_make_unique<PetscLinearSolver<T>>(comm);
78 #ifdef LIBMESH_TRILINOS_HAVE_AZTECOO 80 return libmesh_make_unique<AztecLinearSolver<T>>(comm);
84 #ifdef LIBMESH_HAVE_EIGEN 86 return libmesh_make_unique<EigenSparseLinearSolver<T>>(comm);
90 libmesh_error_msg(
"ERROR: Unrecognized solver package: " << solver_package);
93 return std::unique_ptr<LinearSolver<T>>();
101 return _preconditioner->type();
103 return _preconditioner_type;
106 template <
typename T>
111 _preconditioner->set_type(pct);
113 _preconditioner_type = pct;
116 template <
typename T>
121 libmesh_error_msg(
"Preconditioner must be attached before the solver is initialized!");
124 _preconditioner = preconditioner;
127 template <
typename T>
131 same_preconditioner = reuse_flag;
134 template <
typename T>
140 libmesh_not_implemented();
144 template <
typename T>
149 const unsigned int n_iter)
152 LOG_SCOPE(
"adjoint_solve()",
"LinearSolver");
160 const std::pair<unsigned int, Real> totalrval = this->solve (mat, sol, rhs, tol, n_iter);
169 template <
typename T>
176 template <
typename T>
179 _solver_configuration = &solver_configuration;
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
void libmesh_ignore(const Args &...)
LinearSolver(const libMesh::Parallel::Communicator &comm_in)
An object whose state is distributed along a set of processors.
std::string enum_to_string(const T e)
virtual void get_transpose(SparseMatrix< T > &dest) const =0
OStreamProxy out(std::cout)