54 [[nodiscard]]
virtual Index size() const noexcept = 0;
55 [[nodiscard]] virtual std::
string name() const = 0;
59 [[nodiscard]] virtual std::
string details()
const {
return {}; }
149 const char* backend);
Factorise once, solve for many right-hand sides.
Definition linear_solver.hpp:17
LinearSolver(LinearSolver &&)=delete
virtual Index factor_entries() const noexcept
Definition linear_solver.hpp:63
virtual const LinearSolver * backend() const noexcept
Definition linear_solver.hpp:66
virtual Matrix solve_many(const Matrix &rhs) const
virtual Vector solve(const Vector &rhs) const =0
LinearSolver & operator=(LinearSolver &&)=delete
virtual Index size() const noexcept=0
virtual void factorize(const SparseMatrix &matrix)=0
virtual std::string name() const =0
virtual ~LinearSolver()=default
virtual void refactorize(const SparseMatrix &matrix)
Definition linear_solver.hpp:34
LinearSolver(const LinearSolver &)=delete
virtual std::string details() const
Definition linear_solver.hpp:59
LinearSolver & operator=(const LinearSolver &)=delete
virtual Vector solve_transposed(const Vector &rhs) const
virtual Matrix solve_transposed_many(const Matrix &rhs) const
Definition device_arnoldi.hpp:23
std::string cudss_status()
Symmetry detect_symmetry(const SparseMatrix &matrix, Real tolerance=1e-12)
Real asymmetry(const SparseMatrix &matrix)
std::string backend_name(DirectSolverBackend backend)
bool exploit_symmetry(Symmetry symmetry, const SparseMatrix &matrix, const char *backend)
Vector solve_direct(const SparseMatrix &matrix, const Vector &rhs, DirectSolverBackend backend=DirectSolverBackend::kAuto, Symmetry symmetry=Symmetry::kGeneral)
Factorise and solve in one go.
SparseMatrix upper_triangle(const SparseMatrix &matrix)
Upper triangle (column ≥ row) of a square matrix, compressed; the input of the LDLᵀ paths.
DirectSolverBackend
Direct solver backends.
Definition linear_solver.hpp:70
@ kMumps
MUMPS (multifrontal, zmumps), needs HPFEM_ENABLE_MUMPS
@ kCudss
NVIDIA cuDSS on the GPU, needs HPFEM_ENABLE_CUDA and the hpfem_gpu library.
@ kSparseLu
Eigen SparseLU, always available.
std::unique_ptr< LinearSolver > make_mumps(Symmetry symmetry=Symmetry::kGeneral)
bool available(DirectSolverBackend backend) noexcept
True if the backend can be used in this build (kAuto always).
std::unique_ptr< LinearSolver > make_cudss(Symmetry symmetry=Symmetry::kGeneral)
std::unique_ptr< LinearSolver > make_direct_solver(DirectSolverBackend backend=DirectSolverBackend::kAuto, Symmetry symmetry=Symmetry::kGeneral)
std::vector< DirectSolverBackend > available_backends()
All backends usable in this build.
Symmetry
Definition linear_solver.hpp:84
@ kComplexSymmetric
A = Aᵀ with complex entries; only the upper triangle is used.
@ kGeneral
no structure assumed (LU)
std::unique_ptr< LinearSolver > make_sparse_lu(Symmetry symmetry=Symmetry::kGeneral)
double Real
Definition types.hpp:15
Eigen::Matrix< Complex, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition types.hpp:22
Eigen::SparseMatrix< Complex, Eigen::RowMajor, Index > SparseMatrix
Definition types.hpp:24
std::int64_t Index
global indices (DoFs, entities)
Definition types.hpp:17
Eigen::Matrix< Complex, Eigen::Dynamic, 1 > Vector
Definition types.hpp:20