From 32a0a7238c3a412deefd97c5b57249cbda257ed6 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Mon, 13 Apr 2020 19:05:37 +0200 Subject: [PATCH] [linear] Remove deprecated interfaces, alias, parameters --- dumux/linear/CMakeLists.txt | 3 -- dumux/linear/amgbackend.hh | 25 +----------- dumux/linear/amgparallelhelpers.hh | 31 -------------- dumux/linear/amgtraits.hh | 40 ------------------- dumux/linear/solver.hh | 38 ++---------------- dumux/linear/vectorexchange.hh | 36 ----------------- test/freeflow/navierstokes/sincos/main.cc | 1 + test/freeflow/shallowwater/bowl/main.cc | 1 + .../2p/sequential/test_impesproblem.hh | 8 +++- 9 files changed, 13 insertions(+), 170 deletions(-) delete mode 100644 dumux/linear/amgparallelhelpers.hh delete mode 100644 dumux/linear/amgtraits.hh delete mode 100644 dumux/linear/vectorexchange.hh diff --git a/dumux/linear/CMakeLists.txt b/dumux/linear/CMakeLists.txt index 1b5e58026f..2219a6309a 100644 --- a/dumux/linear/CMakeLists.txt +++ b/dumux/linear/CMakeLists.txt @@ -1,7 +1,5 @@ install(FILES amgbackend.hh -amgparallelhelpers.hh -amgtraits.hh istlsolverfactorybackend.hh linearsolverparameters.hh linearsolvertraits.hh @@ -12,5 +10,4 @@ pdesolver.hh scotchbackend.hh seqsolverbackend.hh solver.hh -vectorexchange.hh DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dumux/linear) diff --git a/dumux/linear/amgbackend.hh b/dumux/linear/amgbackend.hh index da23a6a307..c5484ee554 100644 --- a/dumux/linear/amgbackend.hh +++ b/dumux/linear/amgbackend.hh @@ -234,29 +234,6 @@ private: bool firstCall_; }; -// deprecation helper -> will be removed after 3.2 -template<class GridView, class Traits> -using ParallelAMGBackend -= AMGBiCGSTABBackend<Traits>; - -} // namespace Dumux - -#include <dumux/common/properties.hh> -#include <dumux/linear/linearsolvertraits.hh> - -namespace Dumux { - -/*! - * \ingroup Linear - * \brief A linear solver based on the ISTL AMG preconditioner - * and the ISTL BiCGSTAB solver. - * \note This is an adaptor using a TypeTag - */ -template<class TypeTag> -using AMGBackend [[deprecated("Use AMGBiCGSTABBackend instead. Will be removed after 3.2!")]] -= ParallelAMGBackend<typename GetPropType<TypeTag, Properties::GridGeometry>::GridView, - LinearSolverTraits<GetPropType<TypeTag, Properties::GridGeometry>>>; - -} // namespace Dumux +} // end namespace Dumux #endif // DUMUX_AMGBACKEND_HH diff --git a/dumux/linear/amgparallelhelpers.hh b/dumux/linear/amgparallelhelpers.hh deleted file mode 100644 index e1f9a65ed8..0000000000 --- a/dumux/linear/amgparallelhelpers.hh +++ /dev/null @@ -1,31 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup Linear - * \brief Provides a helper class for nonoverlapping - * decomposition using the ISTL AMG. - */ -#ifndef DUMUX_AMGPARALLELHELPERS_HH -#define DUMUX_AMGPARALLELHELPERS_HH - -#include "parallelhelpers.hh" -#warning "This header is deprecated and will be removed after release 3.2. Use linearsolver/parallelhelpers.hh" - -#endif // DUMUX_AMGPARALLELHELPERS_HH diff --git a/dumux/linear/amgtraits.hh b/dumux/linear/amgtraits.hh deleted file mode 100644 index c3ac240112..0000000000 --- a/dumux/linear/amgtraits.hh +++ /dev/null @@ -1,40 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup Linear - * \brief Define traits for the AMG backend. - */ -#ifndef DUMUX_AMG_TRAITS_HH -#define DUMUX_AMG_TRAITS_HH - -#warning "This header is deprecated and will be removed after release 3.2. Use linearsolver/linearsolvertraits.hh" - -#include "linearsolvertraits.hh" - - -namespace Dumux { - -//! The type traits required for using the AMG backend -template<class MType, class VType, class GridGeometry> -using AmgTraits [[deprecated("Use LinearSolverTraits<GridGeometry> instead. AmgTraits will be removed after 3.2!")]] = LinearSolverTraits<GridGeometry>; - -} // end namespace Dumux - -#endif // DUMUX_AMG_TRAITS_HH diff --git a/dumux/linear/solver.hh b/dumux/linear/solver.hh index 943545c42a..0b20771557 100644 --- a/dumux/linear/solver.hh +++ b/dumux/linear/solver.hh @@ -56,41 +56,9 @@ public: verbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Verbosity", 0); maxIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.MaxIterations", 250); residReduction_ = getParamFromGroup<double>(paramGroup, "LinearSolver.ResidualReduction", 1e-13); - - // for deprecation period we ask also for the "old" parameters but print a warning - // the "new" style parameter takes precedence - // TODO: Remove all this code after 3.2 and use commented code below - if (hasParamInGroup(paramGroup, "LinearSolver.PreconditionerRelaxation")) - { - std::cerr << "Deprecation warning: parameter LinearSolver.PreconditionerRelaxation is deprecated and will be removed after 3.2. " - << "Use LinearSolver.Preconditioner.Relaxation instead (Preconditioner subgroup)." << std::endl; - relaxation_ = getParamFromGroup<double>(paramGroup, "LinearSolver.PreconditionerRelaxation"); - } - else - relaxation_ = getParamFromGroup<double>(paramGroup, "LinearSolver.Preconditioner.Relaxation", 1); - - if (hasParamInGroup(paramGroup, "LinearSolver.PreconditionerIterations")) - { - std::cerr << "Deprecation warning: parameter LinearSolver.PreconditionerIterations is deprecated and will be removed after 3.2. " - << "Use LinearSolver.Preconditioner.Iterations instead (Preconditioner subgroup)." << std::endl; - precondIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.PreconditionerIterations"); - } - else - precondIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Preconditioner.Iterations", 1); - - if (hasParamInGroup(paramGroup, "LinearSolver.PreconditionerVerbosity")) - { - std::cerr << "Deprecation warning: parameter LinearSolver.PreconditionerVerbosity is deprecated and will be removed after 3.2. " - << "Use LinearSolver.Preconditioner.Verbosity instead (Preconditioner subgroup)." << std::endl; - precondVerbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.PreconditionerVerbosity"); - } - else - precondVerbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Preconditioner.Verbosity", 0); - - // TODO: use this code instead of the above code after release 3.2 - // relaxation_ = getParamFromGroup<double>(paramGroup, "LinearSolver.Preconditioner.Relaxation", 1); - // precondIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Preconditioner.Iterations", 1); - // precondVerbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Preconditioner.Verbosity", 0); + relaxation_ = getParamFromGroup<double>(paramGroup, "LinearSolver.Preconditioner.Relaxation", 1); + precondIter_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Preconditioner.Iterations", 1); + precondVerbosity_ = getParamFromGroup<int>(paramGroup, "LinearSolver.Preconditioner.Verbosity", 0); } /*! diff --git a/dumux/linear/vectorexchange.hh b/dumux/linear/vectorexchange.hh deleted file mode 100644 index dd586e7508..0000000000 --- a/dumux/linear/vectorexchange.hh +++ /dev/null @@ -1,36 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * \ingroup Linear - * \brief Contains a class to exchange entries of a vector - */ -#ifndef DUMUX_VECTOR_EXCHANGE_HH -#define DUMUX_VECTOR_EXCHANGE_HH - -#warning "This header is deprecated and will be removed after release 3.2. Use parallel/vectorcommdatahandle.hh" - -#include <dumux/parallel/vectorcommdatahandle.hh> - -namespace Dumux { - template<class Mapper, class Vector> - using VectorExchange [[deprecated("Use VectorCommDataHandleEqual<Mapper, Vector, 0> instead. Will be removed after 3.2!")]] = VectorCommDataHandleEqual<Mapper, Vector, 0/*elementCodim*/>; -} // end namespace Dumux - -#endif diff --git a/test/freeflow/navierstokes/sincos/main.cc b/test/freeflow/navierstokes/sincos/main.cc index 12f0bc9fac..b6303edd28 100644 --- a/test/freeflow/navierstokes/sincos/main.cc +++ b/test/freeflow/navierstokes/sincos/main.cc @@ -44,6 +44,7 @@ #include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> #include <dumux/linear/seqsolverbackend.hh> +#include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dune/common/version.hh> diff --git a/test/freeflow/shallowwater/bowl/main.cc b/test/freeflow/shallowwater/bowl/main.cc index b5559bea76..3099e69c65 100644 --- a/test/freeflow/shallowwater/bowl/main.cc +++ b/test/freeflow/shallowwater/bowl/main.cc @@ -37,6 +37,7 @@ #include <dumux/common/dumuxmessage.hh> #include <dumux/io/grid/gridmanager.hh> +#include <dumux/linear/linearsolvertraits.hh> #include <dumux/linear/amgbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> diff --git a/test/porousmediumflow/2p/sequential/test_impesproblem.hh b/test/porousmediumflow/2p/sequential/test_impesproblem.hh index e9c97499ae..302ddd41f6 100644 --- a/test/porousmediumflow/2p/sequential/test_impesproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_impesproblem.hh @@ -44,6 +44,7 @@ #include <dumux/porousmediumflow/2p/sequential/transport/cellcentered/evalcflfluxcoats.hh> #include <dumux/linear/amgbackend.hh> +#include <dumux/linear/linearsolvertraits.hh> namespace Dumux { @@ -112,7 +113,12 @@ struct EvalCflFluxFunction<TypeTag, TTag::IMPESTest> { using type = EvalCflFluxC // use the AMG backend for the corresponding test template<class TypeTag> -struct LinearSolver<TypeTag, TTag::IMPESTestWithAMG> { using type = AMGBackend<TypeTag>; }; +struct LinearSolver<TypeTag, TTag::IMPESTestWithAMG> +{ + using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; + using type = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; + +}; // Set the grid type template<class TypeTag> struct Grid<TypeTag, TTag::IMPESTestWithAMG> { using type = Dune::YaspGrid<2>; }; -- GitLab