40 GMRESSmoother() : underlying_operator(
nullptr), preconditioner(
nullptr)
46 delete preconditioner;
47 preconditioner =
nullptr;
50 GMRESSmoother(GMRESSmoother
const &) =
delete;
53 operator=(GMRESSmoother
const &) =
delete;
60 AdditionalData() : preconditioner(PreconditionerSmoother::None), number_of_iterations(5)
65 PreconditionerSmoother preconditioner;
68 unsigned int number_of_iterations;
72 setup(Operator
const & operator_in,
73 bool const initialize_preconditioner,
74 AdditionalData
const & additional_data_in)
76 underlying_operator = &operator_in;
78 data = additional_data_in;
80 if(data.preconditioner == PreconditionerSmoother::PointJacobi)
85 else if(data.preconditioner == PreconditionerSmoother::BlockJacobi)
88 new BlockJacobiPreconditioner<Operator>(*underlying_operator, initialize_preconditioner);
92 AssertThrow(data.preconditioner == PreconditionerSmoother::None,
94 "Specified preconditioner not implemented for GMRES smoother"));
101 if(preconditioner !=
nullptr)
102 preconditioner->update();
107 vmult(VectorType & dst, VectorType
const & src)
const final
114 step(VectorType & dst, VectorType
const & src)
const final
116 dealii::IterationNumberControl control(data.number_of_iterations, 1.e-20);
118 typename dealii::SolverGMRES<VectorType>::AdditionalData additional_data;
119 additional_data.right_preconditioning =
true;
120 dealii::SolverGMRES<VectorType> solver(control, additional_data);
122 if(preconditioner !=
nullptr)
123 solver.solve(*underlying_operator, dst, src, *preconditioner);
125 solver.solve(*underlying_operator, dst, src, dealii::PreconditionIdentity());
129 Operator
const * underlying_operator;
133 PreconditionerBase<typename Operator::value_type> * preconditioner;