Skip to content
Snippets Groups Projects
Commit 3e1d8092 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

[Math/Eigen] support PardisoLU if MKL is available

parent b4ebd64d
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
#include <logog/include/logog.hpp> #include <logog/include/logog.hpp>
#ifdef USE_MKL
#include <Eigen/PardisoSupport>
#endif
#include "BaseLib/ConfigTree.h" #include "BaseLib/ConfigTree.h"
#include "EigenVector.h" #include "EigenVector.h"
#include "EigenMatrix.h" #include "EigenMatrix.h"
...@@ -174,6 +178,13 @@ EigenLinearSolver::EigenLinearSolver( ...@@ -174,6 +178,13 @@ EigenLinearSolver::EigenLinearSolver(
_solver = details::createIterativeSolver(_option.solver_type, _solver = details::createIterativeSolver(_option.solver_type,
_option.precon_type); _option.precon_type);
return; return;
#ifdef USE_MKL
case EigenOption::SolverType::PardisoLU: {
using SolverType = Eigen::PardisoLU<EigenMatrix::RawMatrixType>;
_solver.reset(new details::EigenDirectLinearSolver<SolverType>);
return;
}
#endif
} }
OGS_FATAL("Invalid Eigen linear solver type. Aborting."); OGS_FATAL("Invalid Eigen linear solver type. Aborting.");
......
...@@ -29,6 +29,10 @@ EigenOption::SolverType EigenOption::getSolverType(const std::string &solver_nam ...@@ -29,6 +29,10 @@ EigenOption::SolverType EigenOption::getSolverType(const std::string &solver_nam
return SolverType::BiCGSTAB; return SolverType::BiCGSTAB;
if (solver_name == "SparseLU") if (solver_name == "SparseLU")
return SolverType::SparseLU; return SolverType::SparseLU;
#ifdef USE_MKL
if (solver_name == "PardisoLU")
return SolverType::PardisoLU;
#endif
OGS_FATAL("Unknown Eigen solver type `%s'", solver_name.c_str()); OGS_FATAL("Unknown Eigen solver type `%s'", solver_name.c_str());
} }
......
...@@ -24,6 +24,9 @@ struct EigenOption final ...@@ -24,6 +24,9 @@ struct EigenOption final
CG, CG,
BiCGSTAB, BiCGSTAB,
SparseLU SparseLU
#ifdef USE_MKL
, PardisoLU
#endif
}; };
/// Preconditioner type /// Preconditioner type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment