13#ifndef dealii_mg_block_smoother_h
14#define dealii_mg_block_smoother_h
47template <
typename MatrixType,
typename RelaxationType,
typename number>
73 template <
typename MGMatrixType,
typename MGRelaxationType>
135template <
typename MatrixType,
typename RelaxationType,
typename number>
137 const unsigned int steps,
139 const bool symmetric,
144 , mem(&this->vector_memory)
148template <
typename MatrixType,
typename RelaxationType,
typename number>
152 unsigned int i = matrices.min_level(), max_level = matrices.max_level();
153 for (; i <= max_level; ++i)
161template <
typename MatrixType,
typename RelaxationType,
typename number>
162template <
typename MGMatrixType,
typename MGRelaxationType>
165 const MGMatrixType &m,
166 const MGRelaxationType &s)
168 const unsigned int min = m.min_level();
169 const unsigned int max = m.max_level();
171 matrices.resize(min, max);
172 smoothers.resize(min, max);
174 for (
unsigned int i = min; i <=
max; ++i)
179 matrices[i] = linear_operator<BlockVector<number>>(
181 smoothers[i] = linear_operator<BlockVector<number>>(matrices[i], s[i]);
186template <
typename MatrixType,
typename RelaxationType,
typename number>
195template <
typename MatrixType,
typename RelaxationType,
typename number>
199 return sizeof(*this) + matrices.memory_consumption() +
200 smoothers.memory_consumption() +
201 this->vector_memory.memory_consumption();
205template <
typename MatrixType,
typename RelaxationType,
typename number>
208 const unsigned int level,
214 unsigned int maxlevel = matrices.max_level();
215 unsigned int steps2 = this->steps;
218 steps2 *= (1 << (maxlevel -
level));
226 if (this->symmetric && (steps2 % 2 == 0))
229 for (
unsigned int i = 0; i < steps2; ++i)
233 matrices[
level].vmult(*r, u);
234 r->sadd(-1., 1., rhs);
235 smoothers[
level].Tvmult(*d, *r);
239 matrices[
level].vmult(*r, u);
240 r->sadd(-1., 1., rhs);
241 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
void initialize(const MGMatrixType &matrices, const MGRelaxationType &smoothers)
void set_reverse(const bool)
ObserverPointer< VectorMemory< BlockVector< number > >, MGSmootherBlock< MatrixType, RelaxationType, number > > mem
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
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)