mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Make update method of preconditioners parameter-less again.
Previously, it got passed the weights only needed for CPR. Additionally those were passed with the parameter tree to the update method and constructor. Now the CPR constructor gets a function to use for recalculating the weights and the property is not changed. Unfortunately this means that the preconditioner creators of the factory get another parameter.
This commit is contained in:
@@ -58,7 +58,19 @@ testSolver(const boost::property_tree::ptree& prm, const std::string& matrix_fil
|
||||
}
|
||||
readMatrixMarket(rhs, rhsfile);
|
||||
}
|
||||
Dune::FlexibleSolver<Matrix, Vector> solver(prm, matrix);
|
||||
bool transpose = false;
|
||||
|
||||
if(prm.get<std::string>("preconditioner.type") == "cprt"){
|
||||
transpose = true;
|
||||
}
|
||||
auto wc = [&matrix, &prm, transpose]()
|
||||
{
|
||||
return Opm::Amg::getQuasiImpesWeights<Matrix,
|
||||
Vector>(matrix,
|
||||
prm.get<int>("preconditioner.pressure_var_index"),
|
||||
transpose);
|
||||
};
|
||||
Dune::FlexibleSolver<Matrix, Vector> solver(prm, matrix, wc);
|
||||
Vector x(rhs.size());
|
||||
Dune::InverseOperatorResult res;
|
||||
solver.apply(x, rhs, res);
|
||||
|
Reference in New Issue
Block a user