38 JacobiSmoother() : underlying_operator(
nullptr), preconditioner(
nullptr)
44 delete preconditioner;
45 preconditioner =
nullptr;
48 JacobiSmoother(JacobiSmoother
const &) =
delete;
51 operator=(JacobiSmoother
const &) =
delete;
59 : preconditioner(PreconditionerSmoother::PointJacobi),
60 number_of_smoothing_steps(5),
66 PreconditionerSmoother preconditioner;
69 unsigned int number_of_smoothing_steps;
72 double damping_factor;
76 setup(Operator
const & operator_in,
77 bool const initialize_preconditioner,
78 AdditionalData
const & additional_data_in)
80 underlying_operator = &operator_in;
82 data = additional_data_in;
84 if(data.preconditioner == PreconditionerSmoother::PointJacobi)
89 else if(data.preconditioner == PreconditionerSmoother::BlockJacobi)
92 new BlockJacobiPreconditioner<Operator>(*underlying_operator, initialize_preconditioner);
94 else if(data.preconditioner == PreconditionerSmoother::AdditiveSchwarz)
96 preconditioner =
new AdditiveSchwarzPreconditioner<Operator>(*underlying_operator,
97 initialize_preconditioner);
101 AssertThrow(data.preconditioner == PreconditionerSmoother::PointJacobi or
102 data.preconditioner == PreconditionerSmoother::BlockJacobi,
104 "Specified type of preconditioner for Jacobi smoother not implemented."));
111 if(preconditioner !=
nullptr)
112 preconditioner->update();
130 vmult(VectorType & dst, VectorType
const & src)
const final
134 VectorType tmp(src), residual(src);
136 for(
unsigned int k = 0; k < data.number_of_smoothing_steps; ++k)
141 underlying_operator->vmult(residual, dst);
142 residual.sadd(-1.0, 1.0, src);
150 preconditioner->vmult(tmp, residual);
153 dst.add(data.damping_factor, tmp);
158 step(VectorType & dst, VectorType
const & src)
const final
160 VectorType tmp(src), residual(src);
162 for(
unsigned int k = 0; k < data.number_of_smoothing_steps; ++k)
165 underlying_operator->vmult(residual, dst);
166 residual.sadd(-1.0, 1.0, src);
169 preconditioner->vmult(tmp, residual);
172 dst.add(data.damping_factor, tmp);
177 Operator
const * underlying_operator;
181 PreconditionerBase<typename Operator::value_type> * preconditioner;