Factorise once, solve for many right-hand sides.
More...
#include <linear_solver.hpp>
Factorise once, solve for many right-hand sides.
◆ LinearSolver() [1/3]
| hpfem::solvers::LinearSolver::LinearSolver |
( |
| ) |
|
|
default |
◆ LinearSolver() [2/3]
| hpfem::solvers::LinearSolver::LinearSolver |
( |
const LinearSolver & |
| ) |
|
|
delete |
◆ LinearSolver() [3/3]
| hpfem::solvers::LinearSolver::LinearSolver |
( |
LinearSolver && |
| ) |
|
|
delete |
◆ ~LinearSolver()
| virtual hpfem::solvers::LinearSolver::~LinearSolver |
( |
| ) |
|
|
virtualdefault |
◆ backend()
| virtual const LinearSolver * hpfem::solvers::LinearSolver::backend |
( |
| ) |
const |
|
inlinevirtualnoexcept |
The solver doing the work: the object itself, or for kAuto the backend it chose in factorize (null before). Lets GPU-side algorithms recognise the cuDSS backend.
◆ details()
| virtual std::string hpfem::solvers::LinearSolver::details |
( |
| ) |
const |
|
inlinevirtual |
Backend-specific facts about the current factorisation for logs and benchmarks (entries in the factors, memory, mode); empty before factorize or if the backend has nothing to say.
◆ factor_entries()
| virtual Index hpfem::solvers::LinearSolver::factor_entries |
( |
| ) |
const |
|
inlinevirtualnoexcept |
Entries of the factors of the current factorisation (L + U, or L of an LDLᵀ path), the quantity estimate_memory predicts; -1 before factorize or if the backend does not report it.
◆ factorize()
| virtual void hpfem::solvers::LinearSolver::factorize |
( |
const SparseMatrix & |
matrix | ) |
|
|
pure virtual |
- Exceptions
-
| Error | if the matrix is singular or the factorisation fails. |
◆ name()
| virtual std::string hpfem::solvers::LinearSolver::name |
( |
| ) |
const |
|
pure virtual |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ refactorize()
| virtual void hpfem::solvers::LinearSolver::refactorize |
( |
const SparseMatrix & |
matrix | ) |
|
|
inlinevirtual |
Factorises another matrix with the sparsity pattern of the last one, reusing the symbolic analysis (ordering, elimination tree): MUMPS runs its numerical phase only, SparseLU keeps its column permutation; cuDSS factorises anew. Falls back to factorize when nothing was factorised yet or the pattern differs (same result, no reuse). Sweeps that change values but not structure — frequency, materials, Bloch phases — call this per point (physics::ConicalSweep).
◆ size()
| virtual Index hpfem::solvers::LinearSolver::size |
( |
| ) |
const |
|
pure virtualnoexcept |
◆ solve()
| virtual Vector hpfem::solvers::LinearSolver::solve |
( |
const Vector & |
rhs | ) |
const |
|
pure virtual |
- Exceptions
-
| Error | if factorize has not succeeded or the size does not match. |
◆ solve_many()
| virtual Matrix hpfem::solvers::LinearSolver::solve_many |
( |
const Matrix & |
rhs | ) |
const |
|
virtual |
Several right-hand sides at once (one per column); backends with a native multi-rhs solve override this, the default solves column by column.
- Exceptions
-
| Error | if factorize has not succeeded or the row count does not match. |
◆ solve_transposed()
| virtual Vector hpfem::solvers::LinearSolver::solve_transposed |
( |
const Vector & |
rhs | ) |
const |
|
virtual |
Solves with the transposed matrix, \( A^\top x = b \) (transposed, not conjugated), on the current factorisation: the adjoint systems of the sensitivities (ADR-0012). A complex-symmetric factorisation (the LDLᵀ paths) solves with A itself; SparseLU and MUMPS use their factors transposed; cuDSS factorises Aᵀ on the first call after a (re)factorisation of a general matrix and keeps it (twice the device memory).
- Exceptions
-
| Error | if factorize has not succeeded or the backend has no transposed solve, InvalidArgument if the size does not match. |
◆ solve_transposed_many()
| virtual Matrix hpfem::solvers::LinearSolver::solve_transposed_many |
( |
const Matrix & |
rhs | ) |
const |
|
virtual |
Several right-hand sides of the transposed system at once (one per column); the default solves column by column.
- Exceptions
-
The documentation for this class was generated from the following file: