Commit 5b74637f authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

In the Eigen backend, the preconditioners and direct solvers might reuse the...

In the Eigen backend, the preconditioners and direct solvers might reuse the symbolic pattern of factorization
parent e034a097
Pipeline #1416 passed with stage
in 29 minutes and 5 seconds
......@@ -27,12 +27,17 @@ namespace AMDiS
: solver_{}
{
SolverConfig<LU>::init(prefix, solver_);
Parameters::get(prefix + "->reuse pattern", reusePattern_);
}
/// Implementes \ref RunnerInterface::init()
virtual void init(Matrix const& A) override
{
solver_.compute(A);
if (!reusePattern_ || !initialized_) {
solver_.analyzePattern(A);
initialized_ = true;
}
solver_.factorize(A);
test_exit(solver_.info() == Eigen::Success,
"Error in solver.compute(matrix)");
......@@ -60,5 +65,7 @@ namespace AMDiS
private:
LU solver_;
bool reusePattern_ = false;
bool initialized_ = false;
};
}
......@@ -22,13 +22,18 @@ namespace AMDiS
{
SolverCfg::init(prefix, solver_);
PreconCfg::init(prefix + "->precon", solver_.preconditioner());
Parameters::get(prefix + "->reuse pattern", reusePattern_);
}
/// Implementes \ref RunnerInterface::init()
virtual void init(Matrix const& A) override
{
solver_.compute(A);
if (!reusePattern_ || !initialized_) {
solver_.analyzePattern(A);
initialized_ = true;
}
solver_.factorize(A);
test_exit(solver_.info() == Eigen::Success,
"Error in solver.compute(matrix)");
......@@ -58,6 +63,8 @@ namespace AMDiS
private:
IterativeSolver solver_;
bool reusePattern_ = false;
bool initialized_ = false;
};
} // end namespace AMDiS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment