20 #ifndef __EIGEN_FACTORY_H 21 #define __EIGEN_FACTORY_H 27 #include <dolfin/common/MPI.h> 28 #include <dolfin/log/log.h> 29 #include "EigenKrylovSolver.h" 30 #include "EigenLUSolver.h" 31 #include "EigenMatrix.h" 32 #include "EigenVector.h" 33 #include "TensorLayout.h" 34 #include "GenericLinearAlgebraFactory.h" 39 class GenericLinearSolver;
52 {
return std::make_shared<EigenMatrix>(); }
56 {
return std::make_shared<EigenVector>(comm); }
60 std::size_t rank)
const 64 sparsity = TensorLayout::Sparsity::SPARSE;
65 return std::make_shared<TensorLayout>(comm, 0, sparsity);
71 dolfin_not_implemented();
72 std::shared_ptr<GenericLinearOperator> A;
77 std::shared_ptr<GenericLinearSolver>
80 return std::make_shared<EigenLUSolver>(method);
84 std::shared_ptr<GenericLinearSolver>
87 std::string preconditioner)
const 89 std::shared_ptr<GenericLinearSolver>
static EigenFactory & instance()
Return singleton instance.
Definition: EigenFactory.h:107
Sparsity
Sparse or dense layout.
Definition: TensorLayout.h:47
std::shared_ptr< GenericLinearSolver > create_lu_solver(MPI_Comm comm, std::string method) const
Create LU solver.
Definition: EigenFactory.h:78
std::map< std::string, std::string > krylov_solver_methods() const
Return a list of available Krylov solver methods.
Definition: EigenFactory.h:99
std::shared_ptr< GenericVector > create_vector(MPI_Comm comm) const
Create empty vector.
Definition: EigenFactory.h:55
std::shared_ptr< TensorLayout > create_layout(MPI_Comm comm, std::size_t rank) const
Create empty tensor layout.
Definition: EigenFactory.h:59
static std::map< std::string, std::string > methods()
Return a list of available solver methods.
Definition: EigenKrylovSolver.cpp:58
std::map< std::string, std::string > lu_solver_methods() const
Return a list of available LU solver methods.
Definition: EigenFactory.h:95
Base class for LinearAlgebra factories.
Definition: GenericLinearAlgebraFactory.h:46
std::map< std::string, std::string > krylov_solver_preconditioners() const
Return a list of available preconditioners.
Definition: EigenFactory.h:103
static std::map< std::string, std::string > preconditioners()
Return a list of available preconditioners.
Definition: EigenKrylovSolver.cpp:63
std::shared_ptr< GenericLinearSolver > create_krylov_solver(MPI_Comm comm, std::string method, std::string preconditioner) const
Create Krylov solver.
Definition: EigenFactory.h:85
static std::map< std::string, std::string > methods()
Return a list of available solver methods.
Definition: EigenLUSolver.cpp:137
virtual ~EigenFactory()
Destructor.
Definition: EigenFactory.h:48
std::shared_ptr< GenericMatrix > create_matrix(MPI_Comm comm) const
Create empty matrix.
Definition: EigenFactory.h:51
Eigen linear algebra factory.
Definition: EigenFactory.h:43
std::shared_ptr< GenericLinearOperator > create_linear_operator(MPI_Comm comm) const
Create empty linear operator.
Definition: EigenFactory.h:69
Definition: EigenKrylovSolver.h:40