Merge pull request #1712 from andlaus/fix_ebos_convergence

adapt to the new preparation procedure of ewoms linear solvers
This commit is contained in:
Atgeirr Flø Rasmussen authored and GitHub committed 2019-01-21 14:54:09 +01:00
commit a00972dc0b
2 files changed
+15 -3

No files matched your search

+7 -1
View File
@@ -481,7 +481,13 @@ namespace Opm {
x = 0.0;
auto& ebosSolver = ebosSimulator_.model().newtonMethod().linearSolver();
ebosSolver.prepare(ebosJac, ebosResid);
ebosSolver.prepare(ebosJac);
ebosSolver.setResidual(ebosResid);
// actually, the error needs to be calculated after setResidual in order to
// account for parallelization properly. since the residual of ECFV
// discretizations does not need to be synchronized across processes to be
// consistent, this is not relevant for OPM-flow...
ebosSolver.setJacobian(ebosJac);
ebosSolver.solve(x);
}
+8 -2
View File
@@ -208,11 +208,17 @@ protected:
matrix_for_preconditioner_.reset();
}
void prepare(const SparseMatrixAdapter& M, Vector& b) {
matrix_ = &M.istlMatrix();
void prepare(const SparseMatrixAdapter& M) {
}
void setResidual(Vector& b) {
rhs_ = &b;
}
void setJacobian(const SparseMatrixAdapter& M) {
matrix_ = &M.istlMatrix();
}
bool solve(Vector& x) {
// Solve system.