16 #ifndef dealii_mg_block_smoother_h 17 #define dealii_mg_block_smoother_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/mg_level_object.h> 23 #include <deal.II/base/smartpointer.h> 25 #include <deal.II/lac/block_vector.h> 26 #include <deal.II/lac/linear_operator.h> 27 #include <deal.II/lac/vector_memory.h> 29 #include <deal.II/multigrid/mg_smoother.h> 33 DEAL_II_NAMESPACE_OPEN
50 template <
typename MatrixType,
class RelaxationType,
typename number>
62 const unsigned int steps = 1,
90 template <
class MGMatrixType,
class MGRelaxationType>
112 smooth(
const unsigned int level,
152 template <
typename MatrixType,
class RelaxationType,
typename number>
155 const unsigned int steps,
165 template <
typename MatrixType,
class RelaxationType,
typename number>
167 const unsigned int steps,
178 template <
typename MatrixType,
class RelaxationType,
typename number>
183 for (; i <= max_level; ++i)
191 template <
typename MatrixType,
class RelaxationType,
typename number>
192 template <
class MGMatrixType,
class MGRelaxationType>
195 const MGMatrixType & m,
196 const MGRelaxationType &s)
198 const unsigned int min = m.min_level();
199 const unsigned int max = m.max_level();
204 for (
unsigned int i = min; i <= max; ++i)
209 matrices[i] = linear_operator<BlockVector<number>>(
216 template <
typename MatrixType,
class RelaxationType,
typename number>
225 template <
typename MatrixType,
class RelaxationType,
typename number>
235 template <
typename MatrixType,
class RelaxationType,
typename number>
238 const unsigned int level,
245 unsigned int steps2 = this->
steps;
248 steps2 *= (1 << (maxlevel - level));
256 if (this->symmetric && (steps2 % 2 == 0))
259 for (
unsigned int i = 0; i < steps2; ++i)
264 r->sadd(-1., 1., rhs);
270 r->sadd(-1., 1., rhs);
281 DEAL_II_NAMESPACE_CLOSE
std::size_t memory_consumption() const
void initialize(const MGMatrixType &matrices, const MGRelaxationType &smoothers)
MGLevelObject< LinearOperator< BlockVector< number > > > smoothers
SmartPointer< VectorMemory< BlockVector< number > >, MGSmootherBlock< MatrixType, RelaxationType, number > > mem
void set_reverse(const bool)
virtual void smooth(const unsigned int level, BlockVector< number > &u, const BlockVector< number > &rhs) const
MGSmootherBlock(VectorMemory< BlockVector< number >> &mem, const unsigned int steps=1, const bool variable=false, const bool symmetric=false, const bool transpose=false, const bool reverse=false)
unsigned int max_level() const
GrowingVectorMemory< BlockVector< number > > vector_memory
virtual std::size_t memory_consumption() const
std::size_t memory_consumption() const
MGLevelObject< LinearOperator< BlockVector< number > > > matrices
unsigned int min_level() const
void resize(const unsigned int new_minlevel, const unsigned int new_maxlevel)