mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-08-17 17:34:49 -05:00
Merge pull request #1718 from andlaus/mea_culpa
Properly adapt to the new linear solver API used by eWoms
This commit is contained in:
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
BEGIN_PROPERTIES
|
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_STRING_PROP(EclFlowProblem, OutputDir, "");
|
||||||
SET_BOOL_PROP(EclFlowProblem, EnableDebuggingChecks, false);
|
SET_BOOL_PROP(EclFlowProblem, EnableDebuggingChecks, false);
|
||||||
// default in flow is to formulate the equations in surface volumes
|
// default in flow is to formulate the equations in surface volumes
|
||||||
@@ -481,13 +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);
|
ebosSolver.prepare(ebosJac, ebosResid);
|
||||||
ebosSolver.setResidual(ebosResid);
|
ebosSolver.setResidual(ebosResid);
|
||||||
// actually, the error needs to be calculated after setResidual in order to
|
// actually, the error needs to be calculated after setResidual in order to
|
||||||
// account for parallelization properly. since the residual of ECFV
|
// account for parallelization properly. since the residual of ECFV
|
||||||
// discretizations does not need to be synchronized across processes to be
|
// discretizations does not need to be synchronized across processes to be
|
||||||
// consistent, this is not relevant for OPM-flow...
|
// consistent, this is not relevant for OPM-flow...
|
||||||
ebosSolver.setJacobian(ebosJac);
|
ebosSolver.setMatrix(ebosJac);
|
||||||
ebosSolver.solve(x);
|
ebosSolver.solve(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -208,14 +208,18 @@ protected:
|
|||||||
matrix_for_preconditioner_.reset();
|
matrix_for_preconditioner_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepare(const SparseMatrixAdapter& M) {
|
void prepare(const SparseMatrixAdapter& M, const Vector& b) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setResidual(Vector& b) {
|
void setResidual(Vector& b) {
|
||||||
rhs_ = &b;
|
rhs_ = &b;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setJacobian(const SparseMatrixAdapter& M) {
|
void getResidual(Vector& b) const {
|
||||||
|
b = *rhs_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setMatrix(const SparseMatrixAdapter& M) {
|
||||||
matrix_ = &M.istlMatrix();
|
matrix_ = &M.istlMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user