20#ifndef LIBMESH_LASPACK_LINEAR_SOLVER_H
21#define LIBMESH_LASPACK_LINEAR_SOLVER_H
23#include "libmesh/libmesh_common.h"
25#if defined(LIBMESH_HAVE_LASPACK)
34#include "libmesh/linear_solver.h"
35#include "libmesh/laspack_vector.h"
36#include "libmesh/laspack_matrix.h"
66 virtual void clear ()
override;
71 virtual void init (
const char * name =
nullptr)
override;
76 virtual std::pair<unsigned int, Real>
80 const std::optional<double> tol = std::nullopt,
81 const std::optional<unsigned int> m_its = std::nullopt)
override;
86 virtual std::pair<unsigned int, Real>
90 const std::optional<double> tol = std::nullopt,
91 const std::optional<unsigned int> m_its = std::nullopt)
override;
96 virtual std::pair<unsigned int, Real>
101 const std::optional<double> tol = std::nullopt,
102 const std::optional<unsigned int> m_its = std::nullopt)
override;
107 virtual std::pair<unsigned int, Real>
111 const std::optional<double> tol = std::nullopt,
112 const std::optional<unsigned int> m_its = std::nullopt)
override;
119 virtual std::pair<unsigned int, Real>
124 const std::optional<double> tol = std::nullopt,
125 const std::optional<unsigned int> m_its = std::nullopt)
override;
158 _precond_type (ILUPrecond)
175std::pair<unsigned int, Real>
180 const std::optional<double>,
181 const std::optional<unsigned int>)
183 libmesh_error_msg(
"ERROR: LASPACK does not support a user-supplied preconditioner!");
185 std::pair<unsigned int, Real> p;
This class provides an interface to Laspack iterative solvers that is compatible with the libMesh Lin...
virtual std::pair< unsigned int, Real > solve(SparseMatrix< T > &matrix, NumericVector< T > &solution, NumericVector< T > &rhs, const std::optional< double > tol=std::nullopt, const std::optional< unsigned int > m_its=std::nullopt) override
Call the Laspack solver.
void set_laspack_preconditioner_type()
Tells LASPACK to use the user-specified preconditioner stored in _preconditioner_type.
virtual std::pair< unsigned int, Real > adjoint_solve(SparseMatrix< T > &matrix, NumericVector< T > &solution, NumericVector< T > &rhs, const std::optional< double > tol=std::nullopt, const std::optional< unsigned int > m_its=std::nullopt) override
Call the Laspack solver to solve A^T x = b.
virtual void clear() override
Release all memory and clear data structures.
virtual LinearConvergenceReason get_converged_reason() const override
~LaspackLinearSolver()
Destructor.
virtual void init(const char *name=nullptr) override
Initialize data structures if not done so already.
PrecondProcType _precond_type
Preconditioner type.
virtual void print_converged_reason() const override
Prints a useful message about why the latest linear solve con(di)verged.
LaspackLinearSolver(const libMesh::Parallel::Communicator &comm)
Constructor.
This base class can be inherited from to provide interfaces to linear solvers from different packages...
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
const Parallel::Communicator & comm() const
Generic shell matrix, i.e.
The libMesh namespace provides an interface to certain functionality in the library.
LinearConvergenceReason
Linear solver convergence flags (taken from the PETSc flags).