18 #ifndef __DOLFIN_PETSC_LU_SOLVER_H 19 #define __DOLFIN_PETSC_LU_SOLVER_H 23 #if PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR <= 8 && PETSC_VERSION_RELEASE == 1 24 #define MatSolverType MatSolverPackage 25 #define PCFactorGetMatSolverType PCFactorGetMatSolverPackage 26 #define PCFactorSetMatSolverType PCFactorSetMatSolverPackage 35 #include <dolfin/common/MPI.h> 36 #include "PETScKrylovSolver.h" 41 class GenericLinearOperator;
43 class PETScLinearOperator;
63 std::shared_ptr<const PETScMatrix> A,
64 std::string method=
"default");
68 std::string method=
"default");
74 void set_operator(std::shared_ptr<const GenericLinearOperator> A);
109 std::string
str(
bool verbose)
const;
115 static std::map<std::string, std::string>
methods();
122 {
return "lu_solver"; }
132 static std::map<std::string, const MatSolverType> lumethods;
135 static const MatSolverType select_solver(MPI_Comm comm,
~PETScLUSolver()
Destructor.
Definition: PETScLUSolver.cpp:213
Definition: PETScVector.h:60
PETScLUSolver(MPI_Comm comm, std::string method="default")
Constructor.
Definition: PETScLUSolver.cpp:129
Definition: PETScKrylovSolver.h:54
Definition: PETScTAOSolver.h:51
Definition: GenericLinearOperator.h:42
Definition: PETScMatrix.h:58
std::string str(bool verbose) const
Return informal string representation (pretty-print)
Definition: PETScLUSolver.cpp:292
KSP ksp() const
Return PETSc KSP pointer.
Definition: PETScLUSolver.cpp:308
static Parameters default_parameters()
Default parameter values.
Definition: PETScLUSolver.cpp:121
Definition: PETScLUSolver.h:51
static std::map< std::string, std::string > methods()
Return a list of available solver methods.
Definition: PETScLUSolver.cpp:116
Definition: Parameters.h:94
Definition: PETScSNESSolver.h:45
std::size_t solve(GenericVector &x, const GenericVector &b)
Solve linear system Ax = b.
Definition: PETScLUSolver.cpp:229
std::string parameter_type() const
Return parameter type: "krylov_solver" or "lu_solver".
Definition: PETScLUSolver.h:121
void set_from_options() const
Set options from the PETSc options database.
Definition: PETScLUSolver.cpp:282
void set_operator(std::shared_ptr< const GenericLinearOperator > A)
Set operator (matrix)
Definition: PETScLUSolver.cpp:219
This class provides a general solver for linear systems Ax = b.
Definition: GenericLinearSolver.h:37
void set_options_prefix(std::string options_prefix)
Definition: PETScLUSolver.cpp:272
This class defines a common interface for vectors.
Definition: GenericVector.h:47
std::string get_options_prefix() const
Definition: PETScLUSolver.cpp:277
MPI_Comm mpi_comm() const
Returns the MPI communicator.
Definition: PETScLUSolver.cpp:287