// A lambda that cycles through all preconditioners in sequence applying
// one to the vector src and storing the result in dst:
//
- const auto preconditioner_vmult = [&](auto &dst, const auto &src) {
+ const auto preconditioner_vmult = [&, n_preconditioners](auto &dst,
+ const auto &src) {
// We have no preconditioner that we could apply
if (n_preconditioners == 0)
{
// Return the correct index for constructing the next vector in the
// Krylov space sequence according to the chosen indexing strategy
//
- const auto previous_vector_index = [this](unsigned int i) -> unsigned int {
+ const auto previous_vector_index =
+ [this, n_preconditioners](unsigned int i) -> unsigned int {
switch (indexing_strategy)
{
case IndexingStrategy::fgmres:
case IndexingStrategy::truncated_mpgmres:
// 0, 0, ..., 1, 2, 3, ...
return (1 + i >= n_preconditioners) ? (1 + i - n_preconditioners) : 0;
+ default:
+ DEAL_II_ASSERT_UNREACHABLE();
+ return 0;
}
};
SolverFGMRES<VectorType>::SolverFGMRES(SolverControl &cn,
VectorMemory<VectorType> &mem,
const AdditionalData &data)
- : SolverMPGMRES<VectorType>(cn,
- mem,
- {data.max_basis_size,
- data.orthogonalization_strategy})
+ : SolverMPGMRES<VectorType>(
+ cn,
+ mem,
+ typename SolverMPGMRES<VectorType>::AdditionalData{
+ data.max_basis_size,
+ true,
+ data.orthogonalization_strategy})
{
this->indexing_strategy = SolverMPGMRES<VectorType>::IndexingStrategy::fgmres;
}
DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
SolverFGMRES<VectorType>::SolverFGMRES(SolverControl &cn,
const AdditionalData &data)
- : SolverMPGMRES<VectorType>(cn,
- {data.max_basis_size,
- data.orthogonalization_strategy})
+ : SolverMPGMRES<VectorType>(
+ cn,
+ typename SolverMPGMRES<VectorType>::AdditionalData{
+ data.max_basis_size,
+ true,
+ data.orthogonalization_strategy})
{
this->indexing_strategy = SolverMPGMRES<VectorType>::IndexingStrategy::fgmres;
}