]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Annotate solver classes with vector space vector concept. 16995/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 10 May 2024 02:32:49 +0000 (08:02 +0530)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 10 May 2024 02:32:49 +0000 (08:02 +0530)
12 files changed:
include/deal.II/lac/solver.h
include/deal.II/lac/solver_bicgstab.h
include/deal.II/lac/solver_cg.h
include/deal.II/lac/solver_fire.h
include/deal.II/lac/solver_gmres.h
include/deal.II/lac/solver_idr.h
include/deal.II/lac/solver_minres.h
include/deal.II/lac/solver_qmrs.h
include/deal.II/lac/solver_relaxation.h
include/deal.II/lac/solver_richardson.h
include/deal.II/lac/solver_selector.h
include/deal.II/lac/trilinos_solver.h

index 60f7b4c21c3db302d7b281c67462d08eda556d10..126265ffc5a9b576962853fe13197f3df16a98c7 100644 (file)
@@ -18,6 +18,7 @@
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/subscriptor.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/solver_control.h>
 #include <deal.II/lac/vector_memory.h>
@@ -336,6 +337,7 @@ class Vector;
  * @ingroup Solvers
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverBase : public Subscriptor
 {
 public:
@@ -475,8 +477,8 @@ protected:
 #ifndef DOXYGEN
 
 template <typename VectorType>
-inline SolverControl::State
-SolverBase<VectorType>::StateCombiner::operator()(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+inline SolverControl::State SolverBase<VectorType>::StateCombiner::operator()(
   const SolverControl::State state1,
   const SolverControl::State state2) const
 {
@@ -491,10 +493,11 @@ SolverBase<VectorType>::StateCombiner::operator()(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename Iterator>
 inline SolverControl::State
-SolverBase<VectorType>::StateCombiner::operator()(const Iterator begin,
-                                                  const Iterator end) const
+  SolverBase<VectorType>::StateCombiner::operator()(const Iterator begin,
+                                                    const Iterator end) const
 {
   Assert(begin != end,
          ExcMessage("You can't combine iterator states if no state is given."));
@@ -511,6 +514,7 @@ SolverBase<VectorType>::StateCombiner::operator()(const Iterator begin,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 inline SolverBase<VectorType>::SolverBase(
   SolverControl            &solver_control,
   VectorMemory<VectorType> &vector_memory)
@@ -530,6 +534,7 @@ inline SolverBase<VectorType>::SolverBase(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 inline SolverBase<VectorType>::SolverBase(SolverControl &solver_control)
   : // use the static memory object this class owns
   memory(static_vector_memory)
@@ -548,8 +553,8 @@ inline SolverBase<VectorType>::SolverBase(SolverControl &solver_control)
 
 
 template <typename VectorType>
-inline boost::signals2::connection
-SolverBase<VectorType>::connect(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+inline boost::signals2::connection SolverBase<VectorType>::connect(
   const std::function<SolverControl::State(const unsigned int iteration,
                                            const double       check_value,
                                            const VectorType  &current_iterate)>
index 5cde570ced8e0a474ceca52c3b82823fb1c9ced6..79b3d67974293826fa0c70b2d98fe85211736686 100644 (file)
@@ -21,6 +21,7 @@
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/signaling_nan.h>
 #include <deal.II/base/subscriptor.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/solver.h>
 #include <deal.II/lac/solver_control.h>
@@ -75,6 +76,7 @@ DEAL_II_NAMESPACE_OPEN
  * to observe the progress of the iteration.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverBicgstab : public SolverBase<VectorType>
 {
 public:
@@ -209,6 +211,7 @@ private:
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverBicgstab<VectorType>::IterationResult::IterationResult(
   const bool                 breakdown,
   const SolverControl::State state,
@@ -223,6 +226,7 @@ SolverBicgstab<VectorType>::IterationResult::IterationResult(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverBicgstab<VectorType>::SolverBicgstab(SolverControl            &cn,
                                            VectorMemory<VectorType> &mem,
                                            const AdditionalData     &data)
@@ -233,6 +237,7 @@ SolverBicgstab<VectorType>::SolverBicgstab(SolverControl            &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverBicgstab<VectorType>::SolverBicgstab(SolverControl        &cn,
                                            const AdditionalData &data)
   : SolverBase<VectorType>(cn)
@@ -242,12 +247,12 @@ SolverBicgstab<VectorType>::SolverBicgstab(SolverControl        &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType>
-double
-SolverBicgstab<VectorType>::criterion(const MatrixType &A,
-                                      const VectorType &x,
-                                      const VectorType &b,
-                                      VectorType       &t)
+double SolverBicgstab<VectorType>::criterion(const MatrixType &A,
+                                             const VectorType &x,
+                                             const VectorType &b,
+                                             VectorType       &t)
 {
   A.vmult(t, x);
   return std::sqrt(t.add_and_dot(-1.0, b, t));
@@ -256,23 +261,24 @@ SolverBicgstab<VectorType>::criterion(const MatrixType &A,
 
 
 template <typename VectorType>
-void
-SolverBicgstab<VectorType>::print_vectors(const unsigned int,
-                                          const VectorType &,
-                                          const VectorType &,
-                                          const VectorType &) const
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverBicgstab<VectorType>::print_vectors(const unsigned int,
+                                               const VectorType &,
+                                               const VectorType &,
+                                               const VectorType &) const
 {}
 
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
 typename SolverBicgstab<VectorType>::IterationResult
-SolverBicgstab<VectorType>::iterate(const MatrixType         &A,
-                                    VectorType               &x,
-                                    const VectorType         &b,
-                                    const PreconditionerType &preconditioner,
-                                    const unsigned int        last_step)
+  SolverBicgstab<VectorType>::iterate(const MatrixType         &A,
+                                      VectorType               &x,
+                                      const VectorType         &b,
+                                      const PreconditionerType &preconditioner,
+                                      const unsigned int        last_step)
 {
   // Allocate temporary memory.
   typename VectorMemory<VectorType>::Pointer Vr(this->memory);
@@ -397,12 +403,12 @@ SolverBicgstab<VectorType>::iterate(const MatrixType         &A,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverBicgstab<VectorType>::solve(const MatrixType         &A,
-                                  VectorType               &x,
-                                  const VectorType         &b,
-                                  const PreconditionerType &preconditioner)
+void SolverBicgstab<VectorType>::solve(const MatrixType         &A,
+                                       VectorType               &x,
+                                       const VectorType         &b,
+                                       const PreconditionerType &preconditioner)
 {
   LogStream::Prefix prefix("Bicgstab");
 
index 7423ada1497841832ee028d6252fbde881494391..498df053c42b2ae138c7260b0030d061e6451a4c 100644 (file)
@@ -21,6 +21,7 @@
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/subscriptor.h>
+#include <deal.II/base/template_constraints.h>
 #include <deal.II/base/vectorization.h>
 
 #include <deal.II/lac/solver.h>
@@ -173,6 +174,7 @@ namespace LinearAlgebra
  * the operation after the loop performs a total of 7 reductions in parallel.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverCG : public SolverBase<VectorType>
 {
 public:
@@ -350,6 +352,7 @@ protected:
  * descent method.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverFlexibleCG : public SolverCG<VectorType>
 {
 public:
@@ -391,6 +394,7 @@ public:
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverCG<VectorType>::SolverCG(SolverControl            &cn,
                                VectorMemory<VectorType> &mem,
                                const AdditionalData     &data)
@@ -402,6 +406,7 @@ SolverCG<VectorType>::SolverCG(SolverControl            &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverCG<VectorType>::SolverCG(SolverControl &cn, const AdditionalData &data)
   : SolverBase<VectorType>(cn)
   , additional_data(data)
@@ -411,18 +416,18 @@ SolverCG<VectorType>::SolverCG(SolverControl &cn, const AdditionalData &data)
 
 
 template <typename VectorType>
-void
-SolverCG<VectorType>::print_vectors(const unsigned int,
-                                    const VectorType &,
-                                    const VectorType &,
-                                    const VectorType &) const
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverCG<VectorType>::print_vectors(const unsigned int,
+                                         const VectorType &,
+                                         const VectorType &,
+                                         const VectorType &) const
 {}
 
 
 
 template <typename VectorType>
-inline void
-SolverCG<VectorType>::compute_eigs_and_cond(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+inline void SolverCG<VectorType>::compute_eigs_and_cond(
   const std::vector<typename VectorType::value_type> &diagonal,
   const std::vector<typename VectorType::value_type> &offdiagonal,
   const boost::signals2::signal<void(const std::vector<double> &)>
@@ -1258,12 +1263,12 @@ namespace internal
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverCG<VectorType>::solve(const MatrixType         &A,
-                            VectorType               &x,
-                            const VectorType         &b,
-                            const PreconditionerType &preconditioner)
+void SolverCG<VectorType>::solve(const MatrixType         &A,
+                                 VectorType               &x,
+                                 const VectorType         &b,
+                                 const PreconditionerType &preconditioner)
 {
   using number = typename VectorType::value_type;
 
@@ -1339,8 +1344,8 @@ SolverCG<VectorType>::solve(const MatrixType         &A,
 
 
 template <typename VectorType>
-boost::signals2::connection
-SolverCG<VectorType>::connect_coefficients_slot(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+boost::signals2::connection SolverCG<VectorType>::connect_coefficients_slot(
   const std::function<void(typename VectorType::value_type,
                            typename VectorType::value_type)> &slot)
 {
@@ -1350,8 +1355,8 @@ SolverCG<VectorType>::connect_coefficients_slot(
 
 
 template <typename VectorType>
-boost::signals2::connection
-SolverCG<VectorType>::connect_condition_number_slot(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+boost::signals2::connection SolverCG<VectorType>::connect_condition_number_slot(
   const std::function<void(double)> &slot,
   const bool                         every_iteration)
 {
@@ -1368,8 +1373,8 @@ SolverCG<VectorType>::connect_condition_number_slot(
 
 
 template <typename VectorType>
-boost::signals2::connection
-SolverCG<VectorType>::connect_eigenvalues_slot(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+boost::signals2::connection SolverCG<VectorType>::connect_eigenvalues_slot(
   const std::function<void(const std::vector<double> &)> &slot,
   const bool                                              every_iteration)
 {
@@ -1386,6 +1391,7 @@ SolverCG<VectorType>::connect_eigenvalues_slot(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverFlexibleCG<VectorType>::SolverFlexibleCG(SolverControl            &cn,
                                                VectorMemory<VectorType> &mem,
                                                const AdditionalData &)
@@ -1397,6 +1403,7 @@ SolverFlexibleCG<VectorType>::SolverFlexibleCG(SolverControl            &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverFlexibleCG<VectorType>::SolverFlexibleCG(SolverControl &cn,
                                                const AdditionalData &)
   : SolverCG<VectorType>(cn)
index 0b89dd343f6ee63e02ada78e32abac922b0f213b..4efed16e8592f8b774084e01bddbd37c156821ea 100644 (file)
@@ -19,6 +19,7 @@
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/logstream.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/diagonal_matrix.h>
 #include <deal.II/lac/solver.h>
@@ -87,6 +88,7 @@ DEAL_II_NAMESPACE_OPEN
  * Eidel et al. 2011.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverFIRE : public SolverBase<VectorType>
 {
 public:
@@ -187,6 +189,7 @@ protected:
 #ifndef DOXYGEN
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverFIRE<VectorType>::AdditionalData::AdditionalData(
   const double initial_timestep,
   const double maximum_timestep,
@@ -205,6 +208,7 @@ SolverFIRE<VectorType>::AdditionalData::AdditionalData(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverFIRE<VectorType>::SolverFIRE(SolverControl            &solver_control,
                                    VectorMemory<VectorType> &vector_memory,
                                    const AdditionalData     &data)
@@ -215,6 +219,7 @@ SolverFIRE<VectorType>::SolverFIRE(SolverControl            &solver_control,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverFIRE<VectorType>::SolverFIRE(SolverControl        &solver_control,
                                    const AdditionalData &data)
   : SolverBase<VectorType>(solver_control)
@@ -224,9 +229,9 @@ SolverFIRE<VectorType>::SolverFIRE(SolverControl        &solver_control,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename PreconditionerType>
-void
-SolverFIRE<VectorType>::solve(
+void SolverFIRE<VectorType>::solve(
   const std::function<double(VectorType &, const VectorType &)> &compute,
   VectorType                                                    &x,
   const PreconditionerType &inverse_mass_matrix)
@@ -346,12 +351,12 @@ SolverFIRE<VectorType>::solve(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverFIRE<VectorType>::solve(const MatrixType         &A,
-                              VectorType               &x,
-                              const VectorType         &b,
-                              const PreconditionerType &preconditioner)
+void SolverFIRE<VectorType>::solve(const MatrixType         &A,
+                                   VectorType               &x,
+                                   const VectorType         &b,
+                                   const PreconditionerType &preconditioner)
 {
   std::function<double(VectorType &, const VectorType &)> compute_func =
     [&](VectorType &g, const VectorType &x) -> double {
@@ -372,11 +377,11 @@ SolverFIRE<VectorType>::solve(const MatrixType         &A,
 
 
 template <typename VectorType>
-void
-SolverFIRE<VectorType>::print_vectors(const unsigned int,
-                                      const VectorType &,
-                                      const VectorType &,
-                                      const VectorType &) const
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverFIRE<VectorType>::print_vectors(const unsigned int,
+                                           const VectorType &,
+                                           const VectorType &,
+                                           const VectorType &) const
 {}
 
 
index 418f3931f404a48e3e633475a0025b5131069218..71466995b107a921fc057bee3aa1b0c58ddbec09 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/subscriptor.h>
+#include <deal.II/base/template_constraints.h>
 #include <deal.II/base/vectorization.h>
 
 #include <deal.II/lac/block_vector_base.h>
@@ -347,6 +348,7 @@ namespace internal
  * will then be called from the solver with the estimates as argument.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverGMRES : public SolverBase<VectorType>
 {
 public:
@@ -639,6 +641,7 @@ protected:
  * For more details see @cite Saad1991.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverFGMRES : public SolverBase<VectorType>
 {
 public:
@@ -714,6 +717,7 @@ private:
 #ifndef DOXYGEN
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 inline SolverGMRES<VectorType>::AdditionalData::AdditionalData(
   const unsigned int                             max_basis_size,
   const bool                                     right_preconditioning,
@@ -737,6 +741,7 @@ inline SolverGMRES<VectorType>::AdditionalData::AdditionalData(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverGMRES<VectorType>::SolverGMRES(SolverControl            &cn,
                                      VectorMemory<VectorType> &mem,
                                      const AdditionalData     &data)
@@ -748,6 +753,7 @@ SolverGMRES<VectorType>::SolverGMRES(SolverControl            &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverGMRES<VectorType>::SolverGMRES(SolverControl        &cn,
                                      const AdditionalData &data)
   : SolverBase<VectorType>(cn)
@@ -1717,8 +1723,8 @@ namespace internal
 
 
 template <typename VectorType>
-inline void
-SolverGMRES<VectorType>::compute_eigs_and_cond(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+inline void SolverGMRES<VectorType>::compute_eigs_and_cond(
   const FullMatrix<double> &H_orig,
   const unsigned int        n,
   const boost::signals2::signal<void(const std::vector<std::complex<double>> &)>
@@ -1769,12 +1775,12 @@ SolverGMRES<VectorType>::compute_eigs_and_cond(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverGMRES<VectorType>::solve(const MatrixType         &A,
-                               VectorType               &x,
-                               const VectorType         &b,
-                               const PreconditionerType &preconditioner)
+void SolverGMRES<VectorType>::solve(const MatrixType         &A,
+                                    VectorType               &x,
+                                    const VectorType         &b,
+                                    const PreconditionerType &preconditioner)
 {
   std::unique_ptr<LogStream::Prefix> prefix;
   if (!additional_data.batched_mode)
@@ -2045,10 +2051,11 @@ SolverGMRES<VectorType>::solve(const MatrixType         &A,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 boost::signals2::connection
-SolverGMRES<VectorType>::connect_condition_number_slot(
-  const std::function<void(double)> &slot,
-  const bool                         every_iteration)
+  SolverGMRES<VectorType>::connect_condition_number_slot(
+    const std::function<void(double)> &slot,
+    const bool                         every_iteration)
 {
   if (every_iteration)
     {
@@ -2063,8 +2070,8 @@ SolverGMRES<VectorType>::connect_condition_number_slot(
 
 
 template <typename VectorType>
-boost::signals2::connection
-SolverGMRES<VectorType>::connect_eigenvalues_slot(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+boost::signals2::connection SolverGMRES<VectorType>::connect_eigenvalues_slot(
   const std::function<void(const std::vector<std::complex<double>> &)> &slot,
   const bool every_iteration)
 {
@@ -2081,8 +2088,8 @@ SolverGMRES<VectorType>::connect_eigenvalues_slot(
 
 
 template <typename VectorType>
-boost::signals2::connection
-SolverGMRES<VectorType>::connect_hessenberg_slot(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+boost::signals2::connection SolverGMRES<VectorType>::connect_hessenberg_slot(
   const std::function<void(const FullMatrix<double> &)> &slot,
   const bool                                             every_iteration)
 {
@@ -2099,8 +2106,8 @@ SolverGMRES<VectorType>::connect_hessenberg_slot(
 
 
 template <typename VectorType>
-boost::signals2::connection
-SolverGMRES<VectorType>::connect_krylov_space_slot(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+boost::signals2::connection SolverGMRES<VectorType>::connect_krylov_space_slot(
   const std::function<void(
     const internal::SolverGMRESImplementation::TmpVectors<VectorType> &)> &slot)
 {
@@ -2110,9 +2117,10 @@ SolverGMRES<VectorType>::connect_krylov_space_slot(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 boost::signals2::connection
-SolverGMRES<VectorType>::connect_re_orthogonalization_slot(
-  const std::function<void(int)> &slot)
+  SolverGMRES<VectorType>::connect_re_orthogonalization_slot(
+    const std::function<void(int)> &slot)
 {
   return re_orthogonalize_signal.connect(slot);
 }
@@ -2120,8 +2128,8 @@ SolverGMRES<VectorType>::connect_re_orthogonalization_slot(
 
 
 template <typename VectorType>
-double
-SolverGMRES<VectorType>::criterion()
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+double SolverGMRES<VectorType>::criterion()
 {
   // dummy implementation. this function is not needed for the present
   // implementation of gmres
@@ -2133,6 +2141,7 @@ SolverGMRES<VectorType>::criterion()
 //----------------------------------------------------------------------//
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverFGMRES<VectorType>::SolverFGMRES(SolverControl            &cn,
                                        VectorMemory<VectorType> &mem,
                                        const AdditionalData     &data)
@@ -2143,6 +2152,7 @@ SolverFGMRES<VectorType>::SolverFGMRES(SolverControl            &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverFGMRES<VectorType>::SolverFGMRES(SolverControl        &cn,
                                        const AdditionalData &data)
   : SolverBase<VectorType>(cn)
@@ -2152,12 +2162,12 @@ SolverFGMRES<VectorType>::SolverFGMRES(SolverControl        &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverFGMRES<VectorType>::solve(const MatrixType         &A,
-                                VectorType               &x,
-                                const VectorType         &b,
-                                const PreconditionerType &preconditioner)
+void SolverFGMRES<VectorType>::solve(const MatrixType         &A,
+                                     VectorType               &x,
+                                     const VectorType         &b,
+                                     const PreconditionerType &preconditioner)
 {
   LogStream::Prefix prefix("FGMRES");
 
index 8a5111fa691bd36df9748f1a02126ce6d7226fc8..bb9e059b4a2bd4b14abbfd2b6019125ce2956bd1 100644 (file)
@@ -21,6 +21,7 @@
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/signaling_nan.h>
 #include <deal.II/base/subscriptor.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/block_vector_base.h>
 #include <deal.II/lac/full_matrix.h>
@@ -115,6 +116,7 @@ namespace internal
  * iteration.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverIDR : public SolverBase<VectorType>
 {
 public:
@@ -278,6 +280,7 @@ namespace internal
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverIDR<VectorType>::SolverIDR(SolverControl            &cn,
                                  VectorMemory<VectorType> &mem,
                                  const AdditionalData     &data)
@@ -288,6 +291,7 @@ SolverIDR<VectorType>::SolverIDR(SolverControl            &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverIDR<VectorType>::SolverIDR(SolverControl &cn, const AdditionalData &data)
   : SolverBase<VectorType>(cn)
   , additional_data(data)
@@ -296,22 +300,22 @@ SolverIDR<VectorType>::SolverIDR(SolverControl &cn, const AdditionalData &data)
 
 
 template <typename VectorType>
-void
-SolverIDR<VectorType>::print_vectors(const unsigned int,
-                                     const VectorType &,
-                                     const VectorType &,
-                                     const VectorType &) const
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverIDR<VectorType>::print_vectors(const unsigned int,
+                                          const VectorType &,
+                                          const VectorType &,
+                                          const VectorType &) const
 {}
 
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverIDR<VectorType>::solve(const MatrixType         &A,
-                             VectorType               &x,
-                             const VectorType         &b,
-                             const PreconditionerType &preconditioner)
+void SolverIDR<VectorType>::solve(const MatrixType         &A,
+                                  VectorType               &x,
+                                  const VectorType         &b,
+                                  const PreconditionerType &preconditioner)
 {
   LogStream::Prefix prefix("IDR(s)");
 
index 8043c5164d4c0b316fafbf80168d243240d03b62..50782660878e6120fc8169efa3ec53f52ab25eaa 100644 (file)
@@ -21,6 +21,7 @@
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/signaling_nan.h>
 #include <deal.II/base/subscriptor.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/solver.h>
 #include <deal.II/lac/solver_control.h>
@@ -66,6 +67,7 @@ DEAL_II_NAMESPACE_OPEN
  * to observe the progress of the iteration.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverMinRes : public SolverBase<VectorType>
 {
 public:
@@ -149,6 +151,7 @@ protected:
 #ifndef DOXYGEN
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverMinRes<VectorType>::SolverMinRes(SolverControl            &cn,
                                        VectorMemory<VectorType> &mem,
                                        const AdditionalData &)
@@ -159,6 +162,7 @@ SolverMinRes<VectorType>::SolverMinRes(SolverControl            &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverMinRes<VectorType>::SolverMinRes(SolverControl &cn,
                                        const AdditionalData &)
   : SolverBase<VectorType>(cn)
@@ -168,30 +172,30 @@ SolverMinRes<VectorType>::SolverMinRes(SolverControl &cn,
 
 
 template <typename VectorType>
-double
-SolverMinRes<VectorType>::criterion()
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+double SolverMinRes<VectorType>::criterion()
 {
   return res2;
 }
 
 
 template <typename VectorType>
-void
-SolverMinRes<VectorType>::print_vectors(const unsigned int,
-                                        const VectorType &,
-                                        const VectorType &,
-                                        const VectorType &) const
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverMinRes<VectorType>::print_vectors(const unsigned int,
+                                             const VectorType &,
+                                             const VectorType &,
+                                             const VectorType &) const
 {}
 
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverMinRes<VectorType>::solve(const MatrixType         &A,
-                                VectorType               &x,
-                                const VectorType         &b,
-                                const PreconditionerType &preconditioner)
+void SolverMinRes<VectorType>::solve(const MatrixType         &A,
+                                     VectorType               &x,
+                                     const VectorType         &b,
+                                     const PreconditionerType &preconditioner)
 {
   LogStream::Prefix prefix("minres");
 
index 77903714591f6b1d6a90d04bbf011aeeda42cffe..75e29c73b695ebb0facec0f6f153422b4c73dce4 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/subscriptor.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/solver.h>
 #include <deal.II/lac/solver_control.h>
@@ -90,6 +91,7 @@ DEAL_II_NAMESPACE_OPEN
  * to observe the progress of the iteration.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverQMRS : public SolverBase<VectorType>
 {
 public:
@@ -240,6 +242,7 @@ private:
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverQMRS<VectorType>::IterationResult::IterationResult(
   const SolverControl::State state,
   const double               last_residual)
@@ -250,6 +253,7 @@ SolverQMRS<VectorType>::IterationResult::IterationResult(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverQMRS<VectorType>::SolverQMRS(SolverControl            &cn,
                                    VectorMemory<VectorType> &mem,
                                    const AdditionalData     &data)
@@ -258,7 +262,10 @@ SolverQMRS<VectorType>::SolverQMRS(SolverControl            &cn,
   , step(0)
 {}
 
+
+
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverQMRS<VectorType>::SolverQMRS(SolverControl        &cn,
                                    const AdditionalData &data)
   : SolverBase<VectorType>(cn)
@@ -266,21 +273,25 @@ SolverQMRS<VectorType>::SolverQMRS(SolverControl        &cn,
   , step(0)
 {}
 
+
+
 template <typename VectorType>
-void
-SolverQMRS<VectorType>::print_vectors(const unsigned int,
-                                      const VectorType &,
-                                      const VectorType &,
-                                      const VectorType &) const
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverQMRS<VectorType>::print_vectors(const unsigned int,
+                                           const VectorType &,
+                                           const VectorType &,
+                                           const VectorType &) const
 {}
 
+
+
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverQMRS<VectorType>::solve(const MatrixType         &A,
-                              VectorType               &x,
-                              const VectorType         &b,
-                              const PreconditionerType &preconditioner)
+void SolverQMRS<VectorType>::solve(const MatrixType         &A,
+                                   VectorType               &x,
+                                   const VectorType         &b,
+                                   const PreconditionerType &preconditioner)
 {
   LogStream::Prefix prefix("SQMR");
 
@@ -322,18 +333,21 @@ SolverQMRS<VectorType>::solve(const MatrixType         &A,
   // otherwise exit as normal
 }
 
+
+
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
 typename SolverQMRS<VectorType>::IterationResult
-SolverQMRS<VectorType>::iterate(const MatrixType         &A,
-                                VectorType               &x,
-                                const VectorType         &b,
-                                const PreconditionerType &preconditioner,
-                                VectorType               &r,
-                                VectorType               &u,
-                                VectorType               &q,
-                                VectorType               &t,
-                                VectorType               &d)
+  SolverQMRS<VectorType>::iterate(const MatrixType         &A,
+                                  VectorType               &x,
+                                  const VectorType         &b,
+                                  const PreconditionerType &preconditioner,
+                                  VectorType               &r,
+                                  VectorType               &u,
+                                  VectorType               &q,
+                                  VectorType               &t,
+                                  VectorType               &d)
 {
   SolverControl::State state = SolverControl::iterate;
 
index c0ae0beedb3dbb69118cb7468e1b0e16c7cc7837..cf7df9167e314d6ba9d9eb0eb9887a306843f99e 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/subscriptor.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/solver.h>
 #include <deal.II/lac/solver_control.h>
@@ -53,6 +54,7 @@ DEAL_II_NAMESPACE_OPEN
  * @ingroup Solvers
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverRelaxation : public SolverBase<VectorType>
 {
 public:
@@ -85,6 +87,7 @@ public:
 //----------------------------------------------------------------------//
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverRelaxation<VectorType>::SolverRelaxation(SolverControl &cn,
                                                const AdditionalData &)
   : SolverBase<VectorType>(cn)
@@ -93,12 +96,12 @@ SolverRelaxation<VectorType>::SolverRelaxation(SolverControl &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename RelaxationType>
-void
-SolverRelaxation<VectorType>::solve(const MatrixType     &A,
-                                    VectorType           &x,
-                                    const VectorType     &b,
-                                    const RelaxationType &R)
+void SolverRelaxation<VectorType>::solve(const MatrixType     &A,
+                                         VectorType           &x,
+                                         const VectorType     &b,
+                                         const RelaxationType &R)
 {
   GrowingVectorMemory<VectorType> mem;
   SolverControl::State            conv = SolverControl::iterate;
index cb7d3ff7f63a3ec40091c3a93c75be794f5937c7..54bab807bff74b4fc0503e13e8c3184ee2146bc6 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/signaling_nan.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/solver.h>
 #include <deal.II/lac/solver_control.h>
@@ -60,6 +61,7 @@ DEAL_II_NAMESPACE_OPEN
  * to observe the progress of the iteration.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverRichardson : public SolverBase<VectorType>
 {
 public:
@@ -163,6 +165,7 @@ protected:
 #ifndef DOXYGEN
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 inline SolverRichardson<VectorType>::AdditionalData::AdditionalData(
   const double omega,
   const bool   use_preconditioned_residual)
@@ -172,6 +175,7 @@ inline SolverRichardson<VectorType>::AdditionalData::AdditionalData(
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverRichardson<VectorType>::SolverRichardson(SolverControl            &cn,
                                                VectorMemory<VectorType> &mem,
                                                const AdditionalData     &data)
@@ -182,6 +186,7 @@ SolverRichardson<VectorType>::SolverRichardson(SolverControl            &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverRichardson<VectorType>::SolverRichardson(SolverControl        &cn,
                                                const AdditionalData &data)
   : SolverBase<VectorType>(cn)
@@ -191,12 +196,13 @@ SolverRichardson<VectorType>::SolverRichardson(SolverControl        &cn,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverRichardson<VectorType>::solve(const MatrixType         &A,
-                                    VectorType               &x,
-                                    const VectorType         &b,
-                                    const PreconditionerType &preconditioner)
+void SolverRichardson<VectorType>::solve(
+  const MatrixType         &A,
+  VectorType               &x,
+  const VectorType         &b,
+  const PreconditionerType &preconditioner)
 {
   SolverControl::State conv = SolverControl::iterate;
 
@@ -248,12 +254,13 @@ SolverRichardson<VectorType>::solve(const MatrixType         &A,
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 template <typename MatrixType, typename PreconditionerType>
-void
-SolverRichardson<VectorType>::Tsolve(const MatrixType         &A,
-                                     VectorType               &x,
-                                     const VectorType         &b,
-                                     const PreconditionerType &preconditioner)
+void SolverRichardson<VectorType>::Tsolve(
+  const MatrixType         &A,
+  VectorType               &x,
+  const VectorType         &b,
+  const PreconditionerType &preconditioner)
 {
   SolverControl::State conv           = SolverControl::iterate;
   double               last_criterion = std::numeric_limits<double>::lowest();
@@ -301,20 +308,22 @@ SolverRichardson<VectorType>::Tsolve(const MatrixType         &A,
 }
 
 
+
 template <typename VectorType>
-void
-SolverRichardson<VectorType>::print_vectors(const unsigned int,
-                                            const VectorType &,
-                                            const VectorType &,
-                                            const VectorType &) const
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverRichardson<VectorType>::print_vectors(const unsigned int,
+                                                 const VectorType &,
+                                                 const VectorType &,
+                                                 const VectorType &) const
 {}
 
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 inline typename VectorType::value_type
-SolverRichardson<VectorType>::criterion(const VectorType &r,
-                                        const VectorType &d) const
+  SolverRichardson<VectorType>::criterion(const VectorType &r,
+                                          const VectorType &d) const
 {
   if (!additional_data.use_preconditioned_residual)
     return r.l2_norm();
@@ -324,8 +333,8 @@ SolverRichardson<VectorType>::criterion(const VectorType &r,
 
 
 template <typename VectorType>
-inline void
-SolverRichardson<VectorType>::set_omega(const double om)
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+inline void SolverRichardson<VectorType>::set_omega(const double om)
 {
   additional_data.omega = om;
 }
index 1376a8ab03f7bb3465ef622ce95305f83ded83c6..dbf036333eab5656bb0ee0a2f62d4e7ff557db25 100644 (file)
@@ -19,6 +19,7 @@
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/smartpointer.h>
+#include <deal.II/base/template_constraints.h>
 
 #include <deal.II/lac/precondition.h>
 #include <deal.II/lac/solver.h>
@@ -87,6 +88,7 @@ DEAL_II_NAMESPACE_OPEN
  * access to that new solver.
  */
 template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 class SolverSelector : public Subscriptor
 {
 public:
@@ -115,12 +117,12 @@ public:
    * Solver procedure. Calls the @p solve function of the @p solver whose @p
    * SolverName was specified in the constructor.
    */
-  template <class Matrix, class Preconditioner>
+  template <typename MatrixType, typename PreconditionerType>
   void
-  solve(const Matrix         &A,
-        VectorType           &x,
-        const VectorType     &b,
-        const Preconditioner &precond) const;
+  solve(const MatrixType         &A,
+        VectorType               &x,
+        const VectorType         &b,
+        const PreconditionerType &precond) const;
 
   /**
    * Select a new solver. Note that all solver names used in this class are
@@ -246,6 +248,7 @@ private:
 
 
 template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
 SolverSelector<VectorType>::SolverSelector(const std::string &name,
                                            SolverControl     &solver_control)
   : solver_name(name)
@@ -255,8 +258,8 @@ SolverSelector<VectorType>::SolverSelector(const std::string &name,
 
 
 template <typename VectorType>
-void
-SolverSelector<VectorType>::select(const std::string &name)
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverSelector<VectorType>::select(const std::string &name)
 {
   solver_name = name;
 }
@@ -264,12 +267,12 @@ SolverSelector<VectorType>::select(const std::string &name)
 
 
 template <typename VectorType>
-template <class Matrix, class Preconditioner>
-void
-SolverSelector<VectorType>::solve(const Matrix         &A,
-                                  VectorType           &x,
-                                  const VectorType     &b,
-                                  const Preconditioner &precond) const
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+template <typename MatrixType, typename PreconditionerType>
+void SolverSelector<VectorType>::solve(const MatrixType         &A,
+                                       VectorType               &x,
+                                       const VectorType         &b,
+                                       const PreconditionerType &precond) const
 {
   if (solver_name == "richardson")
     {
@@ -308,8 +311,8 @@ SolverSelector<VectorType>::solve(const Matrix         &A,
 
 
 template <typename VectorType>
-void
-SolverSelector<VectorType>::set_control(SolverControl &ctrl)
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverSelector<VectorType>::set_control(SolverControl &ctrl)
 {
   control = &ctrl;
 }
@@ -317,8 +320,8 @@ SolverSelector<VectorType>::set_control(SolverControl &ctrl)
 
 
 template <typename VectorType>
-std::string
-SolverSelector<VectorType>::get_solver_names()
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+std::string SolverSelector<VectorType>::get_solver_names()
 {
   return "richardson|cg|bicgstab|gmres|fgmres|minres";
 }
@@ -326,8 +329,8 @@ SolverSelector<VectorType>::get_solver_names()
 
 
 template <typename VectorType>
-void
-SolverSelector<VectorType>::set_data(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverSelector<VectorType>::set_data(
   const typename SolverGMRES<VectorType>::AdditionalData &data)
 {
   gmres_data = data;
@@ -336,8 +339,8 @@ SolverSelector<VectorType>::set_data(
 
 
 template <typename VectorType>
-void
-SolverSelector<VectorType>::set_data(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverSelector<VectorType>::set_data(
   const typename SolverFGMRES<VectorType>::AdditionalData &data)
 {
   fgmres_data = data;
@@ -346,8 +349,8 @@ SolverSelector<VectorType>::set_data(
 
 
 template <typename VectorType>
-void
-SolverSelector<VectorType>::set_data(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverSelector<VectorType>::set_data(
   const typename SolverRichardson<VectorType>::AdditionalData &data)
 {
   richardson_data = data;
@@ -356,8 +359,8 @@ SolverSelector<VectorType>::set_data(
 
 
 template <typename VectorType>
-void
-SolverSelector<VectorType>::set_data(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverSelector<VectorType>::set_data(
   const typename SolverCG<VectorType>::AdditionalData &data)
 {
   cg_data = data;
@@ -366,8 +369,8 @@ SolverSelector<VectorType>::set_data(
 
 
 template <typename VectorType>
-void
-SolverSelector<VectorType>::set_data(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverSelector<VectorType>::set_data(
   const typename SolverMinRes<VectorType>::AdditionalData &data)
 {
   minres_data = data;
@@ -376,8 +379,8 @@ SolverSelector<VectorType>::set_data(
 
 
 template <typename VectorType>
-void
-SolverSelector<VectorType>::set_data(
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
+void SolverSelector<VectorType>::set_data(
   const typename SolverBicgstab<VectorType>::AdditionalData &data)
 {
   bicgstab_data = data;
index 9af69640576a879c260043b6bb07bc6382699fa7..6e1dc27f11166da04eecf3b23c16c358f649692c 100644 (file)
@@ -20,6 +20,8 @@
 
 #ifdef DEAL_II_WITH_TRILINOS
 
+#  include <deal.II/base/template_constraints.h>
+
 #  include <deal.II/lac/exceptions.h>
 #  include <deal.II/lac/la_parallel_vector.h>
 #  include <deal.II/lac/solver_control.h>
@@ -687,6 +689,7 @@ namespace TrilinosWrappers
    * targeting deal.II data structures.
    */
   template <typename VectorType>
+  DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
   class SolverBelos
   {
   public:
@@ -775,6 +778,7 @@ namespace TrilinosWrappers
      * https://docs.trilinos.org/latest-release/packages/belos/doc/html/classBelos_1_1MultiVec.html.
      */
     template <typename VectorType>
+    DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
     class MultiVecWrapper
       : public Belos::MultiVec<typename VectorType::value_type>
     {
@@ -1214,6 +1218,7 @@ namespace TrilinosWrappers
      * https://docs.trilinos.org/latest-release/packages/belos/doc/html/classBelos_1_1Operator.html.
      */
     template <typename OperatorType, typename VectorType>
+    DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
     class OperatorWrapper
       : public Belos::Operator<typename VectorType::value_type>
     {
@@ -1283,6 +1288,7 @@ namespace TrilinosWrappers
 
 
   template <typename VectorType>
+  DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
   SolverBelos<VectorType>::SolverBelos(
     SolverControl                              &solver_control,
     const AdditionalData                       &additional_data,
@@ -1295,12 +1301,12 @@ namespace TrilinosWrappers
 
 
   template <typename VectorType>
+  DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
   template <typename OperatorType, typename PreconditionerType>
-  void
-  SolverBelos<VectorType>::solve(const OperatorType       &A_dealii,
-                                 VectorType               &x_dealii,
-                                 const VectorType         &b_dealii,
-                                 const PreconditionerType &P_dealii)
+  void SolverBelos<VectorType>::solve(const OperatorType       &A_dealii,
+                                      VectorType               &x_dealii,
+                                      const VectorType         &b_dealii,
+                                      const PreconditionerType &P_dealii)
   {
     using value_type = typename VectorType::value_type;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.