37 JacobiSmoother() : underlying_operator(
nullptr), preconditioner(
nullptr)
43 delete preconditioner;
44 preconditioner =
nullptr;
47 JacobiSmoother(JacobiSmoother
const &) =
delete;
50 operator=(JacobiSmoother
const &) =
delete;
58 : preconditioner(PreconditionerSmoother::PointJacobi),
59 number_of_smoothing_steps(5),
65 PreconditionerSmoother preconditioner;
68 unsigned int number_of_smoothing_steps;
71 double damping_factor;
75 setup(Operator
const & operator_in,
76 bool const initialize_preconditioner,
77 AdditionalData
const & additional_data_in)
79 underlying_operator = &operator_in;
81 data = additional_data_in;
83 if(data.preconditioner == PreconditionerSmoother::PointJacobi)
88 else if(data.preconditioner == PreconditionerSmoother::BlockJacobi)
91 new BlockJacobiPreconditioner<Operator>(*underlying_operator, initialize_preconditioner);
93 else if(data.preconditioner == PreconditionerSmoother::AdditiveSchwarz)
95 preconditioner =
new AdditiveSchwarzPreconditioner<Operator>(*underlying_operator,
96 initialize_preconditioner);
100 AssertThrow(data.preconditioner == PreconditionerSmoother::PointJacobi or
101 data.preconditioner == PreconditionerSmoother::BlockJacobi,
103 "Specified type of preconditioner for Jacobi smoother not implemented."));
110 if(preconditioner !=
nullptr)
111 preconditioner->update();
129 vmult(VectorType & dst, VectorType
const & src)
const final
133 VectorType tmp(src), residual(src);
135 for(
unsigned int k = 0; k < data.number_of_smoothing_steps; ++k)
140 underlying_operator->vmult(residual, dst);
141 residual.sadd(-1.0, 1.0, src);
149 preconditioner->vmult(tmp, residual);
152 dst.add(data.damping_factor, tmp);
157 step(VectorType & dst, VectorType
const & src)
const final
159 VectorType tmp(src), residual(src);
161 for(
unsigned int k = 0; k < data.number_of_smoothing_steps; ++k)
164 underlying_operator->vmult(residual, dst);
165 residual.sadd(-1.0, 1.0, src);
168 preconditioner->vmult(tmp, residual);
171 dst.add(data.damping_factor, tmp);
176 Operator
const * underlying_operator;
180 PreconditionerBase<typename Operator::value_type> * preconditioner;