Definition at line 26 of file EigenLinearSolver.h.
#include <EigenLinearSolver.h>
◆ EigenLinearSolver()
MathLib::EigenLinearSolver::EigenLinearSolver |
( |
std::string const & | solver_name, |
|
|
EigenOption const & | option ) |
|
explicit |
Constructor
- Parameters
-
solver_name | A name used as a prefix for command line options if there are such options available. |
option | Eigen linear solver options. |
Definition at line 477 of file EigenLinearSolver.cpp.
480{
482
484 {
486 {
487 using SolverType =
488 Eigen::SparseLU<Matrix, Eigen::COLAMDOrdering<int>>;
490 details::EigenDirectLinearSolver<SolverType>>();
491 return;
492 }
501 return;
503 {
504#ifdef USE_MKL
505 using SolverType = Eigen::PardisoLU<EigenMatrix::RawMatrixType>;
506 solver_.reset(
new details::EigenDirectLinearSolver<SolverType>);
507 return;
508#else
510 "The code is not compiled with Intel MKL. Linear solver type "
511 "PardisoLU is not available.");
512#endif
513 }
514 }
515
516 OGS_FATAL(
"Invalid Eigen linear solver type. Aborting.");
517}
std::unique_ptr< EigenLinearSolverBase > solver_
Eigen::SparseMatrix< double, Eigen::RowMajor > RawMatrixType
std::unique_ptr< EigenLinearSolverBase > createIterativeSolver()
PreconType precon_type
Preconditioner type.
SolverType solver_type
Linear solver type.
References MathLib::EigenOption::BiCGSTAB, MathLib::EigenOption::BiCGSTABL, MathLib::EigenOption::CG, MathLib::details::createIterativeSolver(), MathLib::EigenOption::GMRES, MathLib::EigenOption::IDRS, MathLib::EigenOption::IDRSTABL, option_, MathLib::EigenOption::PardisoLU, MathLib::EigenOption::precon_type, solver_, and MathLib::EigenOption::solver_type.
◆ ~EigenLinearSolver()
MathLib::EigenLinearSolver::~EigenLinearSolver |
( |
| ) |
|
|
default |
◆ compute()
Performs the compute() step of the Eigen linear solver.
I.e., computes the (LU) decomposition in case of a direct solver, or computes the preconditioner of an iterative solver.
Definition at line 521 of file EigenLinearSolver.cpp.
524{
525 INFO(
"------------------------------------------------------------------");
526 INFO(
"*** Eigen solver compute()");
527
528 return solver_->compute(A.getRawMatrix(),
option_, linear_solver_behaviour);
529}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
References MathLib::EigenMatrix::getRawMatrix(), and INFO().
◆ getOption()
EigenOption & MathLib::EigenLinearSolver::getOption |
( |
| ) |
|
|
inline |
◆ setAngle()
void MathLib::EigenLinearSolver::setAngle |
( |
| ) |
|
|
protected |
◆ setL()
void MathLib::EigenLinearSolver::setL |
( |
| ) |
|
|
protected |
◆ setOption()
void MathLib::EigenLinearSolver::setOption |
( |
const EigenOption & | option | ) |
|
|
inline |
◆ setResidualUpdate()
void MathLib::EigenLinearSolver::setResidualUpdate |
( |
| ) |
|
|
protected |
◆ setRestart()
void MathLib::EigenLinearSolver::setRestart |
( |
| ) |
|
|
protected |
◆ setS()
void MathLib::EigenLinearSolver::setS |
( |
| ) |
|
|
protected |
◆ setSmoothing()
void MathLib::EigenLinearSolver::setSmoothing |
( |
| ) |
|
|
protected |
◆ solve() [1/2]
◆ solve() [2/2]
Solves the linear system for the given right-hand side b
and initial guess x
.
- Precondition
- compute() must have been called before. (Not necessarily for every
x
and b
separately, but for every new/changed matrix A.
Definition at line 531 of file EigenLinearSolver.cpp.
532{
533 INFO(
"------------------------------------------------------------------");
534 INFO(
"*** Eigen solver solve()");
535
536 return solver_->solve(b.getRawVector(), x.getRawVector(),
option_);
537}
References MathLib::EigenVector::getRawVector(), and INFO().
◆ option_
◆ solver_
The documentation for this class was generated from the following files: