mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-16 01:41:56 -06:00
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:
commit
14bde098ce
@ -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 <<".");
|
||||||
|
Loading…
Reference in New Issue
Block a user