mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-12 17:02:02 -05:00
adapt to the new preparation procedure of ewoms linear solvers
This commit is contained in:
1 parent
4cd8eba331
commit
2563a58db8
2 files changed
+15
-3
No files matched your search
@@ -481,7 +481,13 @@ namespace Opm {
|
|||||||
x = 0.0;
|
x = 0.0;
|
||||||
|
|
||||||
auto& ebosSolver = ebosSimulator_.model().newtonMethod().linearSolver();
|
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);
|
ebosSolver.solve(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -208,11 +208,17 @@ protected:
|
|||||||
matrix_for_preconditioner_.reset();
|
matrix_for_preconditioner_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepare(const SparseMatrixAdapter& M, Vector& b) {
|
void prepare(const SparseMatrixAdapter& M) {
|
||||||
matrix_ = &M.istlMatrix();
|
}
|
||||||
|
|
||||||
|
void setResidual(Vector& b) {
|
||||||
rhs_ = &b;
|
rhs_ = &b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setJacobian(const SparseMatrixAdapter& M) {
|
||||||
|
matrix_ = &M.istlMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
bool solve(Vector& x) {
|
bool solve(Vector& x) {
|
||||||
// Solve system.
|
// Solve system.
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user