From 1fdd88ed1ea5d70662343c1af9d19e2d680815f8 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Wed, 27 Mar 2019 12:45:33 +0100 Subject: [PATCH] Rename Solver class to SolverBase. This aligns with the name chosen for the equivalent class in the TrilinosWrappers and PetscWrappers namespaces. --- include/deal.II/lac/eigen.h | 8 ++--- include/deal.II/lac/solver.h | 41 ++++++++++++++-------- include/deal.II/lac/solver_bicgstab.h | 6 ++-- include/deal.II/lac/solver_cg.h | 6 ++-- include/deal.II/lac/solver_fire.h | 6 ++-- include/deal.II/lac/solver_gmres.h | 12 +++---- include/deal.II/lac/solver_minres.h | 6 ++-- include/deal.II/lac/solver_qmrs.h | 6 ++-- include/deal.II/lac/solver_relaxation.h | 4 +-- include/deal.II/lac/solver_richardson.h | 6 ++-- include/deal.II/optimization/solver_bfgs.h | 4 +-- source/lac/solver.inst.in | 2 +- 12 files changed, 60 insertions(+), 47 deletions(-) diff --git a/include/deal.II/lac/eigen.h b/include/deal.II/lac/eigen.h index ec1bc54888..7a70296d36 100644 --- a/include/deal.II/lac/eigen.h +++ b/include/deal.II/lac/eigen.h @@ -52,7 +52,7 @@ DEAL_II_NAMESPACE_OPEN * @author Guido Kanschat, 2000 */ template > -class EigenPower : private Solver +class EigenPower : private SolverBase { public: /** @@ -131,7 +131,7 @@ protected: * @author Guido Kanschat, 2000, 2003 */ template > -class EigenInverse : private Solver +class EigenInverse : private SolverBase { public: /** @@ -208,7 +208,7 @@ template EigenPower::EigenPower(SolverControl & cn, VectorMemory &mem, const AdditionalData & data) - : Solver(cn, mem) + : SolverBase(cn, mem) , additional_data(data) {} @@ -297,7 +297,7 @@ template EigenInverse::EigenInverse(SolverControl & cn, VectorMemory &mem, const AdditionalData & data) - : Solver(cn, mem) + : SolverBase(cn, mem) , additional_data(data) {} diff --git a/include/deal.II/lac/solver.h b/include/deal.II/lac/solver.h index a62ffbabbf..c26686af8e 100644 --- a/include/deal.II/lac/solver.h +++ b/include/deal.II/lac/solver.h @@ -129,7 +129,7 @@ class Vector; * deal.II library for the built-in vector types, but must be explicitly added * for user-provided vector classes. Otherwise, the linker will complain that * it cannot find the constructors and destructors of GrowingVectorMemory that - * happen in the @p Solver class. + * happen in the @p SolverBase class. * * @code * // Definition and implementation of vector class @@ -185,7 +185,7 @@ class Vector; * *

Observing the progress of linear solver iterations

* - * The Solver class, being the base class for all of the iterative solvers + * The SolverBase class, being the base class for all of the iterative solvers * such as SolverCG, SolverGMRES, etc, provides the facilities by which actual * solver implementations determine whether the iteration is converged, not * yet converged, or has failed. Typically, this is done using an object of @@ -234,7 +234,7 @@ class Vector; * into this scheme: when a SolverControl object is passed to the constructor * of the current class, we simply connect the SolverControl::check() function * of that object as a slot to the signal we maintain here. In other words, - * since a Solver object is always constructed using a SolverControl object, + * since a SolverBase object is always constructed using a SolverControl object, * there is always at least one slot associated with the signal, namely the * one that determines convergence. * @@ -325,7 +325,7 @@ class Vector; * 2014 */ template > -class Solver : public Subscriptor +class SolverBase : public Subscriptor { public: /** @@ -342,8 +342,8 @@ public: * responsibility to guarantee that the lifetime of the two arguments is at * least as long as that of the solver object. */ - Solver(SolverControl & solver_control, - VectorMemory &vector_memory); + SolverBase(SolverControl & solver_control, + VectorMemory &vector_memory); /** * Constructor. Takes a control object which evaluates the conditions for @@ -355,7 +355,7 @@ public: * responsibility to guarantee that the lifetime of the argument is at least * as long as that of the solver object. */ - Solver(SolverControl &solver_control); + SolverBase(SolverControl &solver_control); /** * Connect a function object that will be called periodically within @@ -459,12 +459,24 @@ protected: }; + +/** + * Type definition for the base class for iterative linear solvers. + * This class provides interfaces to a memory pool and the objects that + * determine whether a solver has converged. + * + * @deprecated Use SolverBase instead. + */ +template > +using Solver DEAL_II_DEPRECATED = SolverBase; + + /*-------------------------------- Inline functions ------------------------*/ template inline SolverControl::State -Solver::StateCombiner:: +SolverBase::StateCombiner:: operator()(const SolverControl::State state1, const SolverControl::State state2) const { @@ -481,8 +493,8 @@ operator()(const SolverControl::State state1, template template inline SolverControl::State -Solver::StateCombiner::operator()(const Iterator begin, - const Iterator end) const +SolverBase::StateCombiner::operator()(const Iterator begin, + const Iterator end) const { Assert(begin != end, ExcMessage("You can't combine iterator states if no state is given.")); @@ -499,8 +511,9 @@ Solver::StateCombiner::operator()(const Iterator begin, template -inline Solver::Solver(SolverControl & solver_control, - VectorMemory &vector_memory) +inline SolverBase::SolverBase( + SolverControl & solver_control, + VectorMemory &vector_memory) : memory(vector_memory) { // connect the solver control object to the signal. SolverControl::check @@ -516,7 +529,7 @@ inline Solver::Solver(SolverControl & solver_control, template -inline Solver::Solver(SolverControl &solver_control) +inline SolverBase::SolverBase(SolverControl &solver_control) : // use the static memory object this class owns memory(static_vector_memory) { @@ -534,7 +547,7 @@ inline Solver::Solver(SolverControl &solver_control) template inline boost::signals2::connection -Solver::connect( +SolverBase::connect( const std::function diff --git a/include/deal.II/lac/solver_bicgstab.h b/include/deal.II/lac/solver_bicgstab.h index 90d1d7d468..5ce13b435d 100644 --- a/include/deal.II/lac/solver_bicgstab.h +++ b/include/deal.II/lac/solver_bicgstab.h @@ -121,7 +121,7 @@ namespace internal * */ template > -class SolverBicgstab : public Solver, +class SolverBicgstab : public SolverBase, protected internal::SolverBicgstabData { public: @@ -314,7 +314,7 @@ template SolverBicgstab::SolverBicgstab(SolverControl & cn, VectorMemory &mem, const AdditionalData & data) - : Solver(cn, mem) + : SolverBase(cn, mem) , Vx(nullptr) , Vb(nullptr) , additional_data(data) @@ -325,7 +325,7 @@ SolverBicgstab::SolverBicgstab(SolverControl & cn, template SolverBicgstab::SolverBicgstab(SolverControl & cn, const AdditionalData &data) - : Solver(cn) + : SolverBase(cn) , Vx(nullptr) , Vb(nullptr) , additional_data(data) diff --git a/include/deal.II/lac/solver_cg.h b/include/deal.II/lac/solver_cg.h index 9d1656ca87..3dc4342adb 100644 --- a/include/deal.II/lac/solver_cg.h +++ b/include/deal.II/lac/solver_cg.h @@ -93,7 +93,7 @@ class PreconditionIdentity; * @author W. Bangerth, G. Kanschat, R. Becker and F.-T. Suttmeier */ template > -class SolverCG : public Solver +class SolverCG : public SolverBase { public: /** @@ -242,7 +242,7 @@ template SolverCG::SolverCG(SolverControl & cn, VectorMemory &mem, const AdditionalData & data) - : Solver(cn, mem) + : SolverBase(cn, mem) , additional_data(data) {} @@ -250,7 +250,7 @@ SolverCG::SolverCG(SolverControl & cn, template SolverCG::SolverCG(SolverControl &cn, const AdditionalData &data) - : Solver(cn) + : SolverBase(cn) , additional_data(data) {} diff --git a/include/deal.II/lac/solver_fire.h b/include/deal.II/lac/solver_fire.h index b0fdf22bc7..a31e97e7a4 100644 --- a/include/deal.II/lac/solver_fire.h +++ b/include/deal.II/lac/solver_fire.h @@ -88,7 +88,7 @@ DEAL_II_NAMESPACE_OPEN * @author Vishal Boddu, Denis Davydov, 2017 */ template > -class SolverFIRE : public Solver +class SolverFIRE : public SolverBase { public: /** @@ -214,7 +214,7 @@ template SolverFIRE::SolverFIRE(SolverControl & solver_control, VectorMemory &vector_memory, const AdditionalData & data) - : Solver(solver_control, vector_memory) + : SolverBase(solver_control, vector_memory) , additional_data(data) {} @@ -223,7 +223,7 @@ SolverFIRE::SolverFIRE(SolverControl & solver_control, template SolverFIRE::SolverFIRE(SolverControl & solver_control, const AdditionalData &data) - : Solver(solver_control) + : SolverBase(solver_control) , additional_data(data) {} diff --git a/include/deal.II/lac/solver_gmres.h b/include/deal.II/lac/solver_gmres.h index 04f9fa48ae..d5a7d6a76d 100644 --- a/include/deal.II/lac/solver_gmres.h +++ b/include/deal.II/lac/solver_gmres.h @@ -175,7 +175,7 @@ namespace internal * @author Wolfgang Bangerth, Guido Kanschat, Ralf Hartmann. */ template > -class SolverGMRES : public Solver +class SolverGMRES : public SolverBase { public: /** @@ -457,7 +457,7 @@ protected: * @author Guido Kanschat, 2003 */ template > -class SolverFGMRES : public Solver +class SolverFGMRES : public SolverBase { public: /** @@ -621,7 +621,7 @@ template SolverGMRES::SolverGMRES(SolverControl & cn, VectorMemory &mem, const AdditionalData & data) - : Solver(cn, mem) + : SolverBase(cn, mem) , additional_data(data) {} @@ -630,7 +630,7 @@ SolverGMRES::SolverGMRES(SolverControl & cn, template SolverGMRES::SolverGMRES(SolverControl & cn, const AdditionalData &data) - : Solver(cn) + : SolverBase(cn) , additional_data(data) {} @@ -1182,7 +1182,7 @@ template SolverFGMRES::SolverFGMRES(SolverControl & cn, VectorMemory &mem, const AdditionalData & data) - : Solver(cn, mem) + : SolverBase(cn, mem) , additional_data(data) {} @@ -1191,7 +1191,7 @@ SolverFGMRES::SolverFGMRES(SolverControl & cn, template SolverFGMRES::SolverFGMRES(SolverControl & cn, const AdditionalData &data) - : Solver(cn) + : SolverBase(cn) , additional_data(data) {} diff --git a/include/deal.II/lac/solver_minres.h b/include/deal.II/lac/solver_minres.h index 845928b743..774f21bed4 100644 --- a/include/deal.II/lac/solver_minres.h +++ b/include/deal.II/lac/solver_minres.h @@ -69,7 +69,7 @@ DEAL_II_NAMESPACE_OPEN * @author Thomas Richter, 2000, Luca Heltai, 2006 */ template > -class SolverMinRes : public Solver +class SolverMinRes : public SolverBase { public: /** @@ -155,7 +155,7 @@ template SolverMinRes::SolverMinRes(SolverControl & cn, VectorMemory &mem, const AdditionalData &) - : Solver(cn, mem) + : SolverBase(cn, mem) , res2(numbers::signaling_nan()) {} @@ -164,7 +164,7 @@ SolverMinRes::SolverMinRes(SolverControl & cn, template SolverMinRes::SolverMinRes(SolverControl &cn, const AdditionalData &) - : Solver(cn) + : SolverBase(cn) , res2(numbers::signaling_nan()) {} diff --git a/include/deal.II/lac/solver_qmrs.h b/include/deal.II/lac/solver_qmrs.h index 824412cb12..5e68e3d8e1 100644 --- a/include/deal.II/lac/solver_qmrs.h +++ b/include/deal.II/lac/solver_qmrs.h @@ -92,7 +92,7 @@ DEAL_II_NAMESPACE_OPEN * @author Guido Kanschat, 1999; Ingo Kligge 2017 */ template > -class SolverQMRS : public Solver +class SolverQMRS : public SolverBase { public: /** @@ -255,7 +255,7 @@ template SolverQMRS::SolverQMRS(SolverControl & cn, VectorMemory &mem, const AdditionalData & data) - : Solver(cn, mem) + : SolverBase(cn, mem) , additional_data(data) , step(0) {} @@ -263,7 +263,7 @@ SolverQMRS::SolverQMRS(SolverControl & cn, template SolverQMRS::SolverQMRS(SolverControl & cn, const AdditionalData &data) - : Solver(cn) + : SolverBase(cn) , additional_data(data) , step(0) {} diff --git a/include/deal.II/lac/solver_relaxation.h b/include/deal.II/lac/solver_relaxation.h index dfa17fa1f6..e7c7dab871 100644 --- a/include/deal.II/lac/solver_relaxation.h +++ b/include/deal.II/lac/solver_relaxation.h @@ -56,7 +56,7 @@ DEAL_II_NAMESPACE_OPEN * @date 2010 */ template > -class SolverRelaxation : public Solver +class SolverRelaxation : public SolverBase { public: /** @@ -95,7 +95,7 @@ public: template SolverRelaxation::SolverRelaxation(SolverControl &cn, const AdditionalData &) - : Solver(cn) + : SolverBase(cn) {} diff --git a/include/deal.II/lac/solver_richardson.h b/include/deal.II/lac/solver_richardson.h index b2a59fc349..417eff4b25 100644 --- a/include/deal.II/lac/solver_richardson.h +++ b/include/deal.II/lac/solver_richardson.h @@ -60,7 +60,7 @@ DEAL_II_NAMESPACE_OPEN * @author Ralf Hartmann */ template > -class SolverRichardson : public Solver +class SolverRichardson : public SolverBase { public: /** @@ -175,7 +175,7 @@ template SolverRichardson::SolverRichardson(SolverControl & cn, VectorMemory &mem, const AdditionalData & data) - : Solver(cn, mem) + : SolverBase(cn, mem) , additional_data(data) {} @@ -184,7 +184,7 @@ SolverRichardson::SolverRichardson(SolverControl & cn, template SolverRichardson::SolverRichardson(SolverControl & cn, const AdditionalData &data) - : Solver(cn) + : SolverBase(cn) , additional_data(data) {} diff --git a/include/deal.II/optimization/solver_bfgs.h b/include/deal.II/optimization/solver_bfgs.h index 5f3ed06779..aa23dab64d 100644 --- a/include/deal.II/optimization/solver_bfgs.h +++ b/include/deal.II/optimization/solver_bfgs.h @@ -53,7 +53,7 @@ DEAL_II_NAMESPACE_OPEN * @author Denis Davydov, 2018 */ template -class SolverBFGS : public Solver +class SolverBFGS : public SolverBase { public: /** @@ -195,7 +195,7 @@ SolverBFGS::AdditionalData::AdditionalData( template SolverBFGS::SolverBFGS(SolverControl & solver_control, const AdditionalData &data) - : Solver(solver_control) + : SolverBase(solver_control) , additional_data(data) {} diff --git a/source/lac/solver.inst.in b/source/lac/solver.inst.in index ada5bbf820..7ce237dd36 100644 --- a/source/lac/solver.inst.in +++ b/source/lac/solver.inst.in @@ -17,5 +17,5 @@ for (S : VECTOR_TYPES) { - template class Solver; + template class SolverBase; } -- 2.39.5