mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user