Skip to content
Snippets Groups Projects
Commit 480e5a12 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'fix/uzawa-dune-2.7' into 'master'

Fix istl solver factory  + uzawa for dune-2.7

See merge request !2010
parents 32db16a9 52f327c3
No related branches found
No related tags found
1 merge request!2010Fix istl solver factory + uzawa for dune-2.7
......@@ -26,8 +26,9 @@
#ifndef DUMUX_LINEAR_ISTL_SOLVERFACTORYBACKEND_HH
#define DUMUX_LINEAR_ISTL_SOLVERFACTORYBACKEND_HH
#include <dune/common/version.hh>
#include <memory>
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh>
#include <dune/common/parametertree.hh>
......@@ -70,7 +71,11 @@ int initSolverFactoriesForMultiTypeBlockMatrix()
using TL = Dune::TypeList<M,X,Y>;
auto& dsfac = Dune::DirectSolverFactory<M,X,Y>::instance();
Dune::addRegistryToFactory<TL>(dsfac, Dumux::MultiTypeBlockMatrixDirectSolverTag{});
#if DUNE_VERSION_GT(DUNE_ISTL,2,7)
auto& pfac = Dune::PreconditionerFactory<LinearOperator,X,Y>::instance();
#else
auto& pfac = Dune::PreconditionerFactory<M,X,Y>::instance();
#endif
Dune::addRegistryToFactory<TL>(pfac, Dumux::MultiTypeBlockMatrixPreconditionerTag{});
using TLS = Dune::TypeList<X,Y>;
auto& isfac = Dune::IterativeSolverFactory<X,Y>::instance();
......
......@@ -63,6 +63,7 @@ public:
params["preconditioner.verbosity"] = "0";
params["preconditioner.defaultAggregationSizeMode"] = "isotropic";
params["preconditioner.defaultAggregationDimension"] = std::to_string(LinearSolverTraits::GridView::dimension);
params["preconditioner.maxLevel"] = "100";
params["ParameterGroup"] = paramGroup;
params["preconditioner.ParameterGroup"] = paramGroup;
}
......
......@@ -29,7 +29,6 @@
#include <dune/common/indices.hh>
#include <dune/istl/preconditioners.hh>
#include <dune/istl/paamg/amg.hh>
#include <dune/common/version.hh>
#if HAVE_UMFPACK
#include <dune/istl/umfpack.hh>
......@@ -37,10 +36,7 @@
#include <dumux/common/parameters.hh>
#include <dumux/common/typetraits/matrix.hh>
#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1)
#include <dumux/linear/istlsolverregistry.hh>
#endif
namespace Dumux {
......@@ -110,8 +106,13 @@ public:
* \param mat The matrix to operate on.
* \param params Collection of paramters.
*/
SeqUzawa(const std::shared_ptr<const Dune::AssembledLinearOperator<M,X,Y>>& mat, const Dune::ParameterTree& params)
: matrix_(mat->getmat())
#if DUNE_VERSION_GT(DUNE_ISTL,2,7)
SeqUzawa(const std::shared_ptr<const Dune::AssembledLinearOperator<M,X,Y>>& op, const Dune::ParameterTree& params)
: matrix_(op->getmat())
#else
SeqUzawa(const M& mat, const Dune::ParameterTree& params)
: matrix_(mat)
#endif
, numIterations_(params.get<std::size_t>("iterations"))
, relaxationFactor_(params.get<scalar_field_type>("relaxation"))
, verbosity_(params.get<int>("verbosity"))
......@@ -329,9 +330,7 @@ private:
const bool useDirectVelocitySolverForA_;
};
#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1)
DUMUX_REGISTER_PRECONDITIONER("uzawa", Dumux::MultiTypeBlockMatrixPreconditionerTag, Dune::defaultPreconditionerBlockLevelCreator<Dumux::SeqUzawa, 1>());
#endif
} // end namespace Dumux
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment