25 #ifndef __PETSC_FACTORY_H 26 #define __PETSC_FACTORY_H 30 #include <dolfin/common/types.h> 31 #include "PETScKrylovSolver.h" 32 #include "PETScLUSolver.h" 33 #include "PETScMatrix.h" 34 #include "PETScVector.h" 35 #include "TensorLayout.h" 36 #include "GenericLinearAlgebraFactory.h" 51 std::shared_ptr<GenericMatrix>
create_matrix(MPI_Comm comm)
const;
54 std::shared_ptr<GenericVector>
create_vector(MPI_Comm comm)
const;
58 std::size_t rank)
const;
61 std::shared_ptr<GenericLinearOperator>
65 std::shared_ptr<GenericLinearSolver>
69 std::shared_ptr<GenericLinearSolver>
72 std::string preconditioner)
const;
std::map< std::string, std::string > krylov_solver_methods() const
Return a list of available Krylov solver methods.
Definition: PETScFactory.cpp:82
std::shared_ptr< GenericVector > create_vector(MPI_Comm comm) const
Create empty vector.
Definition: PETScFactory.cpp:43
std::shared_ptr< GenericLinearSolver > create_krylov_solver(MPI_Comm comm, std::string method, std::string preconditioner) const
Create Krylov solver.
Definition: PETScFactory.cpp:70
std::map< std::string, std::string > krylov_solver_preconditioners() const
Return a list of available preconditioners.
Definition: PETScFactory.cpp:88
virtual ~PETScFactory()
Destructor.
Definition: PETScFactory.h:48
Base class for LinearAlgebra factories.
Definition: GenericLinearAlgebraFactory.h:46
std::shared_ptr< TensorLayout > create_layout(MPI_Comm comm, std::size_t rank) const
Create empty tensor layout.
Definition: PETScFactory.cpp:49
std::shared_ptr< GenericLinearOperator > create_linear_operator(MPI_Comm comm) const
Create empty linear operator.
Definition: PETScFactory.cpp:58
std::map< std::string, std::string > lu_solver_methods() const
Return a list of available LU solver methods.
Definition: PETScFactory.cpp:77
std::shared_ptr< GenericLinearSolver > create_lu_solver(MPI_Comm comm, std::string method) const
Create LU solver.
Definition: PETScFactory.cpp:64
std::shared_ptr< GenericMatrix > create_matrix(MPI_Comm comm) const
Create empty matrix.
Definition: PETScFactory.cpp:38
static PETScFactory & instance()
Return singleton instance.
Definition: PETScFactory.h:84
PETSc linear algebra factory.
Definition: PETScFactory.h:43