mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 15:10:09 -05:00
not creating identity matrix for singular matrix inversion
in StandardWellEquations.
This commit is contained in:
1 parent
d791b71e0a
commit
2f18b68f38
1 file changed
+2
-10
@@ -159,16 +159,8 @@ void StandardWellEquations<Scalar, IndexTraits, numEq>::apply(BVector& r) const
|
||||
template<typename Scalar, typename IndexTraits, int numEq>
|
||||
void StandardWellEquations<Scalar, IndexTraits, numEq>::invert()
|
||||
{
|
||||
try {
|
||||
invDuneD_ = duneD_; // Not strictly need if not cpr with well contributions is used
|
||||
detail::invertMatrix(invDuneD_[0][0]);
|
||||
} catch (NumericalProblem&) {
|
||||
// for singular matrices, use identity as the inverse
|
||||
invDuneD_[0][0] = 0.0;
|
||||
for (std::size_t i = 0; i < invDuneD_[0][0].rows(); ++i) {
|
||||
invDuneD_[0][0][i][i] = 1.0;
|
||||
}
|
||||
}
|
||||
invDuneD_ = duneD_; // Not strictly need if not cpr with well contributions is used
|
||||
detail::invertMatrix(invDuneD_[0][0]);
|
||||
}
|
||||
|
||||
template<typename Scalar, typename IndexTraits, int numEq>
|
||||
|
||||
Reference in new issue
Block a user