15#ifndef dealii_mg_block_smoother_h
16#define dealii_mg_block_smoother_h
49template <
typename MatrixType,
typename RelaxationType,
typename number>
75 template <
typename MGMatrixType,
typename MGRelaxationType>
137template <
typename MatrixType,
typename RelaxationType,
typename number>
139 const unsigned int steps,
141 const bool symmetric,
146 , mem(&this->vector_memory)
150template <
typename MatrixType,
typename RelaxationType,
typename number>
154 unsigned int i = matrices.min_level(), max_level = matrices.max_level();
155 for (; i <= max_level; ++i)
163template <
typename MatrixType,
typename RelaxationType,
typename number>
164template <
typename MGMatrixType,
typename MGRelaxationType>
167 const MGMatrixType &m,
168 const MGRelaxationType &s)
170 const unsigned int min = m.min_level();
171 const unsigned int max = m.max_level();
173 matrices.resize(min, max);
174 smoothers.resize(min, max);
176 for (
unsigned int i = min; i <=
max; ++i)
188template <
typename MatrixType,
typename RelaxationType,
typename number>
197template <
typename MatrixType,
typename RelaxationType,
typename number>
201 return sizeof(*this) + matrices.memory_consumption() +
202 smoothers.memory_consumption() +
203 this->vector_memory.memory_consumption();
207template <
typename MatrixType,
typename RelaxationType,
typename number>
210 const unsigned int level,
216 unsigned int maxlevel = matrices.max_level();
217 unsigned int steps2 = this->steps;
220 steps2 *= (1 << (maxlevel -
level));
228 if (this->symmetric && (steps2 % 2 == 0))
231 for (
unsigned int i = 0; i < steps2; ++i)
235 matrices[
level].vmult(*r, u);
236 r->sadd(-1., 1., rhs);
237 smoothers[
level].Tvmult(*d, *r);
241 matrices[
level].vmult(*r, u);
242 r->sadd(-1., 1., rhs);
243 smoothers[
level].vmult(*d, *r);
virtual void smooth(const unsigned int level, BlockVector< number > &u, const BlockVector< number > &rhs) const
MGLevelObject< LinearOperator< BlockVector< number > > > smoothers
std::size_t memory_consumption() const
SmartPointer< VectorMemory< BlockVector< number > >, MGSmootherBlock< MatrixType, RelaxationType, number > > mem
void initialize(const MGMatrixType &matrices, const MGRelaxationType &smoothers)
void set_reverse(const bool)
MGLevelObject< LinearOperator< BlockVector< number > > > matrices
MGSmootherBlock(const unsigned int steps=1, const bool variable=false, const bool symmetric=false, const bool transpose=false, const bool reverse=false)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
LinearOperator< Range, Domain, Payload > linear_operator(const OperatorExemplar &, const Matrix &)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)