#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>
* @ingroup Solvers
*/
template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
class SolverBase : public Subscriptor
{
public:
#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
{
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."));
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
inline SolverBase<VectorType>::SolverBase(
SolverControl &solver_control,
VectorMemory<VectorType> &vector_memory)
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)
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 ¤t_iterate)>
#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>
* 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:
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverBicgstab<VectorType>::IterationResult::IterationResult(
const bool breakdown,
const SolverControl::State state,
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverBicgstab<VectorType>::SolverBicgstab(SolverControl &cn,
VectorMemory<VectorType> &mem,
const AdditionalData &data)
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverBicgstab<VectorType>::SolverBicgstab(SolverControl &cn,
const AdditionalData &data)
: SolverBase<VectorType>(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));
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);
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");
#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>
* 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:
* descent method.
*/
template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
class SolverFlexibleCG : public SolverCG<VectorType>
{
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)
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)
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> &)>
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;
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)
{
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)
{
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)
{
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverFlexibleCG<VectorType>::SolverFlexibleCG(SolverControl &cn,
VectorMemory<VectorType> &mem,
const AdditionalData &)
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverFlexibleCG<VectorType>::SolverFlexibleCG(SolverControl &cn,
const AdditionalData &)
: SolverCG<VectorType>(cn)
#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>
* 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:
#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,
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)
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)
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)
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 {
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
{}
#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>
* 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:
* 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:
#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,
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverGMRES<VectorType>::SolverGMRES(SolverControl &cn,
VectorMemory<VectorType> &mem,
const AdditionalData &data)
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverGMRES<VectorType>::SolverGMRES(SolverControl &cn,
const AdditionalData &data)
: SolverBase<VectorType>(cn)
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>> &)>
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)
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)
{
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)
{
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)
{
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)
{
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);
}
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
//----------------------------------------------------------------------//
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverFGMRES<VectorType>::SolverFGMRES(SolverControl &cn,
VectorMemory<VectorType> &mem,
const AdditionalData &data)
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverFGMRES<VectorType>::SolverFGMRES(SolverControl &cn,
const AdditionalData &data)
: SolverBase<VectorType>(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");
#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>
* iteration.
*/
template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
class SolverIDR : public SolverBase<VectorType>
{
public:
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverIDR<VectorType>::SolverIDR(SolverControl &cn,
VectorMemory<VectorType> &mem,
const AdditionalData &data)
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)
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)");
#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>
* 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:
#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 &)
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverMinRes<VectorType>::SolverMinRes(SolverControl &cn,
const AdditionalData &)
: SolverBase<VectorType>(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");
#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>
* 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:
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)
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverQMRS<VectorType>::SolverQMRS(SolverControl &cn,
VectorMemory<VectorType> &mem,
const AdditionalData &data)
, 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)
, 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");
// 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;
#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>
* @ingroup Solvers
*/
template <typename VectorType = Vector<double>>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
class SolverRelaxation : public SolverBase<VectorType>
{
public:
//----------------------------------------------------------------------//
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverRelaxation<VectorType>::SolverRelaxation(SolverControl &cn,
const AdditionalData &)
: SolverBase<VectorType>(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;
#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>
* 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:
#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)
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverRichardson<VectorType>::SolverRichardson(SolverControl &cn,
VectorMemory<VectorType> &mem,
const AdditionalData &data)
template <typename VectorType>
+DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverRichardson<VectorType>::SolverRichardson(SolverControl &cn,
const AdditionalData &data)
: SolverBase<VectorType>(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;
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();
}
+
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();
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;
}
#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>
* 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:
* 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
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)
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;
}
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")
{
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;
}
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";
}
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;
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;
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;
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;
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;
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;
#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>
* targeting deal.II data structures.
*/
template <typename VectorType>
+ DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
class SolverBelos
{
public:
* 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>
{
* 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>
{
template <typename VectorType>
+ DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverBelos<VectorType>::SolverBelos(
SolverControl &solver_control,
const AdditionalData &additional_data,
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;