Pass a mutable matrix to BdaBridge::solve_system

That function will overwrite zero diagonal values with small nonzero ones.
This commit is contained in:
Markus Blatt 2020-05-13 16:28:15 +02:00
parent d54268513e
commit 85fffee06e
2 changed files with 3 additions and 1 deletions

View File

@ -616,7 +616,8 @@ protected:
if (!useWellConn_) {
simulator_.problem().wellModel().getWellContributions(wellContribs);
}
bdaBridge->solve_system(&getMatrix(), istlb, wellContribs, result);
// Const_cast needed since the CUDA stuff overwrites values for better matrix condition..
bdaBridge->solve_system(const_cast<Matrix*>(&getMatrix()), istlb, wellContribs, result);
if (result.converged) {
// get result vector x from non-Dune backend, iff solve was successful
bdaBridge->get_result(x);

View File

@ -58,6 +58,7 @@ public:
/// Solve linear system, A*x = b
/// \warning Values of A might get overwritten!
/// \param[in] mat matrix A, should be of type Dune::BCRSMatrix
/// \param[in] b vector b, should be of type Dune::BlockVector
/// \param[in] wellContribs contains all WellContributions, to apply them separately, instead of adding them to matrix A