Merge pull request #1718 from andlaus/mea_culpa

Properly adapt to the new linear solver API used by eWoms
This commit is contained in:
Atgeirr Flø Rasmussen
2019-02-01 15:45:45 +01:00
committed by GitHub
2 changed files with 9 additions and 5 deletions

View File

@@ -69,7 +69,7 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(EclFlowProblem, INHERITS_FROM(BlackOilModel, EclBaseProblem, FlowNonLinearSolver, FlowIstlSolver, FlowModelParameters, FlowTimeSteppingParameters));
NEW_TYPE_TAG(EclFlowProblem, INHERITS_FROM(BlackOilModel, EclBaseProblem, FlowNonLinearSolver, FlowModelParameters, FlowTimeSteppingParameters));
SET_STRING_PROP(EclFlowProblem, OutputDir, "");
SET_BOOL_PROP(EclFlowProblem, EnableDebuggingChecks, false);
// default in flow is to formulate the equations in surface volumes
@@ -481,13 +481,13 @@ namespace Opm {
x = 0.0;
auto& ebosSolver = ebosSimulator_.model().newtonMethod().linearSolver();
ebosSolver.prepare(ebosJac);
ebosSolver.prepare(ebosJac, ebosResid);
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.setMatrix(ebosJac);
ebosSolver.solve(x);
}

View File

@@ -208,14 +208,18 @@ protected:
matrix_for_preconditioner_.reset();
}
void prepare(const SparseMatrixAdapter& M) {
void prepare(const SparseMatrixAdapter& M, const Vector& b) {
}
void setResidual(Vector& b) {
rhs_ = &b;
}
void setJacobian(const SparseMatrixAdapter& M) {
void getResidual(Vector& b) const {
b = *rhs_;
}
void setMatrix(const SparseMatrixAdapter& M) {
matrix_ = &M.istlMatrix();
}