Address Static Code Analysis Warnings

In particular, don't print uninitialized memory (Reorder.cpp:left)
and don't capture objects ('prm') that aren't actually used.  While
here, refactor the initialization of the MT19937 random number
generator.  Constructing this object is too expensive to do for each
try, especially when we can just run the generator in place.
This commit is contained in:
Bård Skaflestad
2021-07-13 11:37:57 +02:00
parent 847288ea68
commit 48e1af8bbe
3 changed files with 52 additions and 42 deletions

View File

@@ -67,13 +67,11 @@ testSolver(const Opm::PropertyTree& prm, const std::string& matrix_filename, con
if(prm.get<std::string>("preconditioner.type") == "cprt"){
transpose = true;
}
auto wc = [&matrix, &prm, transpose]()
{
return Opm::Amg::getQuasiImpesWeights<Matrix,
Vector>(matrix,
1,
transpose);
};
auto wc = [&matrix, transpose]()
{
return Opm::Amg::getQuasiImpesWeights<Matrix, Vector>(matrix, 1, transpose);
};
using SeqOperatorType = Dune::MatrixAdapter<Matrix, Vector, Vector>;
SeqOperatorType op(matrix);
Dune::FlexibleSolver<Matrix, Vector> solver(op, prm, wc, 1);