mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add parameters controlling amg usage in cpr preconditioner.
New parameters are: - cpr_use_amg (default false) if true, use AMG preconditioner for elliptic part - cpr_use_bicgstab (default true) if true, use BiCGStab (else use CG) for elliptic part
This commit is contained in:
parent
7874f177b6
commit
5d59a97972
@ -107,9 +107,10 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
/// Construct a system solver.
|
/// Construct a system solver.
|
||||||
/// \param[in] linsolver linear solver to use
|
NewtonIterationBlackoilCPR::NewtonIterationBlackoilCPR(const parameter::ParameterGroup& param)
|
||||||
NewtonIterationBlackoilCPR::NewtonIterationBlackoilCPR(const parameter::ParameterGroup& /*param*/)
|
|
||||||
{
|
{
|
||||||
|
use_amg_ = param.getDefault("cpr_use_amg", false);
|
||||||
|
use_bicgstab_ = param.getDefault("cpr_use_bicgstab", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -185,7 +186,7 @@ namespace Opm
|
|||||||
// typedef Dune::SeqILU0<Mat,Vector,Vector> Preconditioner;
|
// typedef Dune::SeqILU0<Mat,Vector,Vector> Preconditioner;
|
||||||
typedef Opm::CPRPreconditioner<Mat,Vector,Vector> Preconditioner;
|
typedef Opm::CPRPreconditioner<Mat,Vector,Vector> Preconditioner;
|
||||||
const double relax = 1.0;
|
const double relax = 1.0;
|
||||||
Preconditioner precond(istlA, istlAe, relax);
|
Preconditioner precond(istlA, istlAe, relax, use_amg_, use_bicgstab_);
|
||||||
|
|
||||||
// Construct linear solver.
|
// Construct linear solver.
|
||||||
const double tolerance = 1e-3;
|
const double tolerance = 1e-3;
|
||||||
|
@ -42,7 +42,9 @@ namespace Opm
|
|||||||
/// \param[in] param parameters controlling the behaviour of
|
/// \param[in] param parameters controlling the behaviour of
|
||||||
/// the preconditioning and choice of
|
/// the preconditioning and choice of
|
||||||
/// linear solvers.
|
/// linear solvers.
|
||||||
/// Note: parameters currently unused.
|
/// Parameters:
|
||||||
|
/// cpr_use_amg (default false) if true, use AMG preconditioner for elliptic part
|
||||||
|
/// cpr_use_bicgstab (default true) if true, use BiCGStab (else use CG) for elliptic part
|
||||||
NewtonIterationBlackoilCPR(const parameter::ParameterGroup& param);
|
NewtonIterationBlackoilCPR(const parameter::ParameterGroup& param);
|
||||||
|
|
||||||
/// Solve the system of linear equations Ax = b, with A being the
|
/// Solve the system of linear equations Ax = b, with A being the
|
||||||
@ -51,6 +53,10 @@ namespace Opm
|
|||||||
/// \param[in] residual residual object containing A and b.
|
/// \param[in] residual residual object containing A and b.
|
||||||
/// \return the solution x
|
/// \return the solution x
|
||||||
virtual SolutionVector computeNewtonIncrement(const LinearisedBlackoilResidual& residual) const;
|
virtual SolutionVector computeNewtonIncrement(const LinearisedBlackoilResidual& residual) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool use_amg_;
|
||||||
|
bool use_bicgstab_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
Loading…
Reference in New Issue
Block a user