From b41b449c7d234786092f017b155e8dc075f9e893 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Mon, 23 Mar 2020 09:35:10 +0100 Subject: [PATCH] Removed suplicated code for calculating quasi impes weights. Maintaining two versions is just to error prone. --- opm/simulators/linalg/ISTLSolverEbos.hpp | 25 ++---------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/opm/simulators/linalg/ISTLSolverEbos.hpp b/opm/simulators/linalg/ISTLSolverEbos.hpp index 96b06078a..9ed3ac574 100644 --- a/opm/simulators/linalg/ISTLSolverEbos.hpp +++ b/opm/simulators/linalg/ISTLSolverEbos.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -990,29 +991,7 @@ protected: Vector getQuasiImpesWeights() { - Matrix& A = *matrix_; - Vector weights(rhs_->size()); - BlockVector rhs(0.0); - rhs[pressureVarIndex] = 1; - const auto endi = A.end(); - for (auto i = A.begin(); i!=endi; ++i) { - const auto endj = (*i).end(); - MatrixBlockType diag_block(0.0); - for (auto j=(*i).begin(); j!=endj; ++j) { - if (i.index() == j.index()) { - diag_block = (*j); - break; - } - } - BlockVector bweights; - auto diag_block_transpose = Opm::transposeDenseMatrix(diag_block); - diag_block_transpose.solve(bweights, rhs); - double abs_max = - *std::max_element(bweights.begin(), bweights.end(), [](double a, double b){ return std::abs(a) < std::abs(b); } ); - bweights /= std::abs(abs_max); - weights[i.index()] = bweights; - } - return weights; + return Amg::getQuasiImpesWeights(*matrix_, pressureVarIndex, /* transpose=*/ true); } Vector getSimpleWeights(const BlockVector& rhs)