mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-25 02:30:18 -06:00
NewtonBOCPR: allow to use either GMRes or BiCGStab. This will be revised once the new
linear solver interface is in place.
This commit is contained in:
parent
05bee313d3
commit
20316e0a8e
@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright 2014 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2015 IRIS AS
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@ -94,12 +95,21 @@ namespace Opm
|
||||
parallelInformation.copyOwnerToAll(istlb, istlb);
|
||||
Preconditioner precond(opA.getmat(), istlAe, cpr_relax_, cpr_ilu_n_, cpr_use_amg_, cpr_use_bicgstab_, parallelInformation);
|
||||
|
||||
// TODO: Revise when linear solvers interface opm-core is done
|
||||
// Construct linear solver.
|
||||
Dune::RestartedGMResSolver<Vector> linsolve(opA, *sp, precond,
|
||||
linear_solver_reduction_, linear_solver_restart_, linear_solver_maxiter_, linear_solver_verbosity_);
|
||||
|
||||
// Solve system.
|
||||
linsolve.apply(x, istlb, result);
|
||||
// GMRes solver
|
||||
if ( newton_use_gmres_ ) {
|
||||
Dune::RestartedGMResSolver<Vector> linsolve(opA, *sp, precond,
|
||||
linear_solver_reduction_, linear_solver_restart_, linear_solver_maxiter_, linear_solver_verbosity_);
|
||||
// Solve system.
|
||||
linsolve.apply(x, istlb, result);
|
||||
}
|
||||
else { // BiCGstab solver
|
||||
Dune::BiCGSTABSolver<Vector> linsolve(opA, *sp, precond,
|
||||
linear_solver_reduction_, linear_solver_maxiter_, linear_solver_verbosity_);
|
||||
// Solve system.
|
||||
linsolve.apply(x, istlb, result);
|
||||
}
|
||||
}
|
||||
|
||||
mutable int iterations_;
|
||||
@ -107,6 +117,7 @@ namespace Opm
|
||||
unsigned int cpr_ilu_n_;
|
||||
bool cpr_use_amg_;
|
||||
bool cpr_use_bicgstab_;
|
||||
bool newton_use_gmres_;
|
||||
boost::any parallelInformation_;
|
||||
|
||||
double linear_solver_reduction_;
|
||||
|
Loading…
Reference in New Issue
Block a user