Unified interface to the sparse direct solvers. More...
#include <cl_Solver.hpp>
Public Member Functions | |
| Solver (const SolverType aSolverType=gDefaultSolver) | |
| Collective: the constructor synchronizes the solver settings ( not the solver type ) from rank 0 to every rank, so all ranks must construct the Solver together. | |
| Solver (const SolverParameters aParams) | |
| ~Solver () | |
| Solver (const Solver &)=delete | |
| Solver (Solver &&)=delete | |
| Solver & | operator= (const Solver &)=delete |
| Solver & | operator= (Solver &&)=delete |
| SolverType | type () const |
| const SolverParameters & | parameters () const |
| read-only view of the parameters this solver was built with ( e.g. | |
| void | set_symmetry_mode (const SymmetryMode &aMode) |
| symmetry mode, needed for some solvers | |
| void | solve (SpMatrix &aMatrix, Vector< real > &aLHS, Vector< real > &aRHS) |
| Solves A x = b. | |
| void | solve (SpMatrix &aMatrix, Matrix< real > &aLHS, Matrix< real > &aRHS) |
| Same contract as the vector overload, with one right-hand side per column of aRHS; the backend resizes aLHS to that shape. | |
| void | set_petsc (const Preconditioner aPreconditioner, const KrylovMethod aKrylovMethod, const real aEpsilon=1e-8) |
| this does only do something if PETSc is used | |
| void | set_mumps_reordering (const MumpsSerialReodrdering aSerial, const MumpsParallelReodrdering aParallel) |
| Silently ignored unless the solver is MUMPS. | |
| void | set_mumps_blr (const MumpsBlockLowRanking aBlr, const real aEpsilon) |
| void | set_mumps_error_analysis (const MumpsErrorAnalysis aSetting) |
| void | free () |
| Releases the factorization ( the destructor does it too ); the next solve() re-initializes from scratch, including the RHS column count. | |
| solver::Wrapper * | wrapper () |
| Borrowed: the Solver owns and deletes the wrapper; do not keep it past the Solver's lifetime. | |
Unified interface to the sparse direct solvers.
| belfem::Solver::Solver | ( | const SolverType | aSolverType = gDefaultSolver | ) |
Collective: the constructor synchronizes the solver settings ( not the solver type ) from rank 0 to every rank, so all ranks must construct the Solver together.
Both constructors share this contract.
| belfem::Solver::Solver | ( | const SolverParameters | aParams | ) |
| belfem::Solver::~Solver | ( | ) |
|
delete |
|
delete |
| void belfem::Solver::free | ( | ) |
Releases the factorization ( the destructor does it too ); the next solve() re-initializes from scratch, including the RHS column count.
| const SolverParameters & belfem::Solver::parameters | ( | ) | const |
read-only view of the parameters this solver was built with ( e.g.
for setup-time consistency checks against the nonlinear tolerances )
| void belfem::Solver::set_mumps_blr | ( | const MumpsBlockLowRanking | aBlr, |
| const real | aEpsilon ) |
| void belfem::Solver::set_mumps_error_analysis | ( | const MumpsErrorAnalysis | aSetting | ) |
| void belfem::Solver::set_mumps_reordering | ( | const MumpsSerialReodrdering | aSerial, |
| const MumpsParallelReodrdering | aParallel ) |
Silently ignored unless the solver is MUMPS.
The three setters below share this contract.
| void belfem::Solver::set_petsc | ( | const Preconditioner | aPreconditioner, |
| const KrylovMethod | aKrylovMethod, | ||
| const real | aEpsilon = 1e-8 ) |
this does only do something if PETSc is used
| aPreconditioner | |
| aKrylovMethod | |
| aEpsilon |
| void belfem::Solver::set_symmetry_mode | ( | const SymmetryMode & | aMode | ) |
symmetry mode, needed for some solvers
| aMode |
Same contract as the vector overload, with one right-hand side per column of aRHS; the backend resizes aLHS to that shape.
The first solve initializes the wrapper with aRHS's column count. PETSc and STRUMPACK have no matrix overload and abort here.
Solves A x = b.
It is collective for the MPI backends ( MUMPS, STRUMPACK, PETSc ) and local for the others. The first call initializes the wrapper. It does not return a failure status: when the wrapper's soft-fail contract is armed on a backend that has one ( MUMPS, STRUMPACK, PETSc ), a failed factorization or solve is reported by wrapper()->failed(); every other failure aborts ( BELFEM_ERROR ).
| SolverType belfem::Solver::type | ( | ) | const |
|
inline |