mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
#5313 Switch to use FullPivLU instead of the default PartialPivLU
when inverting Tii. The full pivoting is more robust against numerical issues, and to fracture islands.
This commit is contained in:
1 parent
bd0c165d17
commit
581196d5a1
1 file changed
+17
-2
@@ -29,9 +29,11 @@
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/LU>
|
||||
|
||||
#include <iomanip>
|
||||
|
||||
#include <QDebug>
|
||||
#include <fstream>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -350,8 +352,21 @@ void RigTransmissibilityCondenser::calculateCondensedTransmissibilities()
|
||||
}
|
||||
else
|
||||
{
|
||||
MatrixXd Tei = totalSystem.bottomLeftCorner( externalEquationCount, internalEquationCount );
|
||||
m_TiiInv = totalSystem.topLeftCorner( internalEquationCount, internalEquationCount ).inverse();
|
||||
MatrixXd Tei = totalSystem.bottomLeftCorner( externalEquationCount, internalEquationCount );
|
||||
MatrixXd Tii = totalSystem.topLeftCorner( internalEquationCount, internalEquationCount );
|
||||
|
||||
// std::ofstream outFileStream( "D:\\Data\\TestData\\TiiMatrix.txt" );
|
||||
// outFileStream << Tii;
|
||||
|
||||
Eigen::FullPivLU<MatrixXd> solver( Tii );
|
||||
|
||||
// outFileStream << std::endl;
|
||||
// outFileStream << "Rows x Cols: " << Tii.rows() << "x" << Tii.cols() << std::endl;
|
||||
// outFileStream << "Invertible: " << ( solver.isInvertible() ? "True" : "False" ) << std::endl;
|
||||
// outFileStream << "Condition: " << solver.rcond() << std::endl;
|
||||
// outFileStream << "Rank: " << solver.rank() << std::endl;
|
||||
|
||||
m_TiiInv = solver.inverse();
|
||||
m_Tie = totalSystem.topRightCorner( internalEquationCount, externalEquationCount );
|
||||
condensedSystem = Tee - Tei * m_TiiInv * m_Tie;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user