Merge pull request #2570 from blattms/fix-prec-factory-dune-master

Complete future-proofing ILU usage in the preconditioner factory.
This commit is contained in:
Atgeirr Flø Rasmussen 2020-04-27 16:37:27 +02:00 committed by GitHub
commit 14bde098ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,7 +318,11 @@ private:
doAddCreator("kamg", [](const O& op, const P& prm, const std::function<Vector()>&) { doAddCreator("kamg", [](const O& op, const P& prm, const std::function<Vector()>&) {
const std::string smoother = prm.get<std::string>("smoother", "ParOverILU0"); const std::string smoother = prm.get<std::string>("smoother", "ParOverILU0");
if (smoother == "ILU0" || smoother == "ParOverILU0") { if (smoother == "ILU0" || smoother == "ParOverILU0") {
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
using Smoother = SeqILU<M, V, V>;
#else
using Smoother = SeqILU0<M, V, V>; using Smoother = SeqILU0<M, V, V>;
#endif
return makeAmgPreconditioner<Smoother>(op, prm, true); return makeAmgPreconditioner<Smoother>(op, prm, true);
} else if (smoother == "Jac") { } else if (smoother == "Jac") {
using Smoother = SeqJac<M, V, V>; using Smoother = SeqJac<M, V, V>;
@ -333,7 +337,11 @@ private:
using Smoother = SeqSSOR<M, V, V>; using Smoother = SeqSSOR<M, V, V>;
return makeAmgPreconditioner<Smoother>(op, prm, true); return makeAmgPreconditioner<Smoother>(op, prm, true);
} else if (smoother == "ILUn") { } else if (smoother == "ILUn") {
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 7)
using Smoother = SeqILU<M, V, V>;
#else
using Smoother = SeqILUn<M, V, V>; using Smoother = SeqILUn<M, V, V>;
#endif
return makeAmgPreconditioner<Smoother>(op, prm, true); return makeAmgPreconditioner<Smoother>(op, prm, true);
} else { } else {
OPM_THROW(std::invalid_argument, "Properties: No smoother with name " << smoother <<"."); OPM_THROW(std::invalid_argument, "Properties: No smoother with name " << smoother <<".");