mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4028 from akva2/reduce_dup
changed: get rid of duplicate MatrixBlock headers/classes
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <opm/common/utility/numeric/RootFinders.hpp>
|
||||
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
|
||||
#include <opm/simulators/linalg/MatrixBlock.hpp>
|
||||
#include <opm/simulators/linalg/SmallDenseMatrixUtils.hpp>
|
||||
#include <opm/simulators/wells/VFPHelpers.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
@@ -553,7 +553,13 @@ namespace Opm
|
||||
// do the local inversion of D.
|
||||
try {
|
||||
this->invDuneD_ = this->duneD_; // Not strictly need if not cpr with well contributions is used
|
||||
Dune::ISTLUtility::invertMatrix(this->invDuneD_[0][0]);
|
||||
detail::invertMatrix(this->invDuneD_[0][0]);
|
||||
} catch (NumericalProblem&) {
|
||||
// for singular matrices, use identity as the inverse
|
||||
this->invDuneD_[0][0] = 0.0;
|
||||
for (size_t i = 0; i < this->invDuneD_[0][0].rows(); ++i) {
|
||||
this->invDuneD_[0][0][i][i] = 1.0;
|
||||
}
|
||||
} catch( ... ) {
|
||||
OPM_DEFLOG_THROW(NumericalIssue,"Error when inverting local well equations for well " + name(), deferred_logger);
|
||||
}
|
||||
@@ -2172,8 +2178,8 @@ namespace Opm
|
||||
|
||||
for ( auto colB = this->duneB_[0].begin(), endB = this->duneB_[0].end(); colB != endB; ++colB )
|
||||
{
|
||||
Detail::multMatrix(this->invDuneD_[0][0], (*colB), tmp);
|
||||
Detail::negativeMultMatrixTransposed((*colC), tmp, tmpMat);
|
||||
detail::multMatrix(this->invDuneD_[0][0], (*colB), tmp);
|
||||
detail::negativeMultMatrixTransposed((*colC), tmp, tmpMat);
|
||||
jacobian.addToBlock( row_index, colB.index(), tmpMat );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user