16#ifndef dealii_mg_block_smoother_h
17#define dealii_mg_block_smoother_h
50template <
typename MatrixType,
class RelaxationType,
typename number>
76 template <
class MGMatrixType,
class MGRelaxationType>
138template <
typename MatrixType,
class RelaxationType,
typename number>
140 const unsigned int steps,
142 const bool symmetric,
147 , mem(&this->vector_memory)
151template <
typename MatrixType,
class RelaxationType,
typename number>
155 unsigned int i = matrices.min_level(), max_level = matrices.max_level();
156 for (; i <= max_level; ++i)
164template <
typename MatrixType,
class RelaxationType,
typename number>
165template <
class MGMatrixType,
class MGRelaxationType>
168 const MGMatrixType & m,
169 const MGRelaxationType &s)
171 const unsigned int min = m.min_level();
172 const unsigned int max = m.max_level();
174 matrices.resize(min, max);
175 smoothers.resize(min, max);
177 for (
unsigned int i = min; i <=
max; ++i)
182 matrices[i] = linear_operator<BlockVector<number>>(
184 smoothers[i] = linear_operator<BlockVector<number>>(matrices[i], s[i]);
189template <
typename MatrixType,
class RelaxationType,
typename number>
198template <
typename MatrixType,
class RelaxationType,
typename number>
202 return sizeof(*this) + matrices.memory_consumption() +
203 smoothers.memory_consumption() +
204 this->vector_memory.memory_consumption();
208template <
typename MatrixType,
class RelaxationType,
typename number>
211 const unsigned int level,
217 unsigned int maxlevel = matrices.max_level();
218 unsigned int steps2 = this->steps;
221 steps2 *= (1 << (maxlevel -
level));
229 if (this->symmetric && (steps2 % 2 == 0))
232 for (
unsigned int i = 0; i < steps2; ++i)
236 matrices[
level].vmult(*r, u);
237 r->sadd(-1., 1., rhs);
238 smoothers[
level].Tvmult(*d, *r);
242 matrices[
level].vmult(*r, u);
243 r->sadd(-1., 1., rhs);
244 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
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)