|
Reference documentation for deal.II version 9.2.0
|
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\)
\(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\)
\(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\)
\(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Go to the documentation of this file.
31 #include <deal.II/multigrid/mg_transfer_block.templates.h>
33 #include <deal.II/multigrid/mg_transfer_component.templates.h>
34 #include <deal.II/multigrid/multigrid.templates.h>
47 , mg_constrained_dofs(&mg_c)
52 template <
typename number>
54 : memory(nullptr, typeid(*this).name())
58 template <
typename number>
61 if (memory !=
nullptr)
66 template <
typename number>
76 template <
typename number>
82 Assert((to_level >= 1) && (to_level <= prolongation_matrices.size()),
83 ExcIndexRange(to_level, 1, prolongation_matrices.size() + 1));
90 if (this->mg_constrained_dofs !=
nullptr)
91 Assert(this->mg_constrained_dofs->get_user_constraint_matrix(to_level - 1)
100 for (
unsigned int b = 0;
b < this->mg_block.size(); ++
b)
102 if (this->selected[
b])
103 prolongation_matrices[to_level - 1]->block(
b,
b).vmult(
104 dst.
block(this->mg_block[
b]), src.
block(this->mg_block[
b]));
109 template <
typename number>
115 Assert((from_level >= 1) && (from_level <= prolongation_matrices.size()),
116 ExcIndexRange(from_level, 1, prolongation_matrices.size() + 1));
122 for (
unsigned int b = 0;
b < this->mg_block.size(); ++
b)
124 if (this->selected[
b])
126 if (factors.size() != 0)
131 prolongation_matrices[from_level - 1]->block(
b,
b).Tvmult(
132 *aux, src.
block(this->mg_block[
b]));
134 dst.
block(this->mg_block[
b]).
add(factors[
b], *aux);
139 prolongation_matrices[from_level - 1]->block(
b,
b).Tvmult_add(
140 dst.
block(this->mg_block[
b]), src.
block(this->mg_block[
b]));
151 std::size_t result =
sizeof(*this);
176 std::size_t result =
sizeof(*this);
177 result +=
sizeof(
unsigned int) *
sizes.size();
197 template <
typename number>
199 : selected_component(0)
200 , mg_selected_component(0)
204 template <
typename number>
206 : selected_component(0)
207 , mg_selected_component(0)
213 template <
typename number>
219 Assert((to_level >= 1) && (to_level <= prolongation_matrices.size()),
220 ExcIndexRange(to_level, 1, prolongation_matrices.size() + 1));
222 prolongation_matrices[to_level - 1]
223 ->block(mg_target_component[mg_selected_component],
224 mg_target_component[mg_selected_component])
230 template <
typename number>
236 Assert((from_level >= 1) && (from_level <= prolongation_matrices.size()),
237 ExcIndexRange(from_level, 1, prolongation_matrices.size() + 1));
239 prolongation_matrices[from_level - 1]
240 ->block(mg_target_component[mg_selected_component],
241 mg_target_component[mg_selected_component])
242 .Tvmult_add(dst, src);
248 template <
typename number>
255 template <
typename number>
264 template <
typename number>
270 Assert((to_level >= 1) && (to_level <= prolongation_matrices.size()),
271 ExcIndexRange(to_level, 1, prolongation_matrices.size() + 1));
274 if (this->mg_constrained_dofs !=
nullptr)
275 Assert(this->mg_constrained_dofs->get_user_constraint_matrix(to_level - 1)
281 prolongation_matrices[to_level - 1]
282 ->block(selected_block, selected_block)
287 template <
typename number>
293 Assert((from_level >= 1) && (from_level <= prolongation_matrices.size()),
294 ExcIndexRange(from_level, 1, prolongation_matrices.size() + 1));
296 prolongation_matrices[from_level - 1]
297 ->block(selected_block, selected_block)
298 .Tvmult_add(dst, src);
305 #include "multigrid.inst"
virtual void prolongate(const unsigned int to_level, BlockVector< number > &dst, const BlockVector< number > &src) const override
void add(const std::vector< size_type > &indices, const std::vector< OtherNumber > &values)
std::vector< bool > selected
std::vector< types::global_dof_index > block_start
std::vector< std::vector< types::global_dof_index > > mg_component_start
static ::ExceptionBase & ExcNotImplemented()
std::vector< std::shared_ptr< BlockSparseMatrix< double > > > prolongation_matrices
virtual ~MGTransferBlock() override
std::vector< std::vector< types::global_dof_index > > sizes
std::vector< unsigned int > target_component
virtual void prolongate(const unsigned int to_level, Vector< number > &dst, const Vector< number > &src) const override
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
std::vector< unsigned int > mg_target_component
virtual void restrict_and_add(const unsigned int from_level, Vector< number > &dst, const Vector< number > &src) const override
std::vector< std::vector< types::global_dof_index > > mg_block_start
#define DEAL_II_NAMESPACE_OPEN
unsigned int n_blocks() const
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
ComponentMask component_mask
std::vector< std::shared_ptr< BlockSparsityPattern > > prolongation_sparsities
virtual void restrict_and_add(const unsigned int from_level, Vector< number > &dst, const Vector< number > &src) const override
static ::ExceptionBase & ExcNotInitialized()
std::size_t memory_consumption() const
virtual void restrict_and_add(const unsigned int from_level, BlockVector< number > &dst, const BlockVector< number > &src) const override
virtual void reinit(const size_type N, const bool omit_zeroing_entries=false)
std::size_t memory_consumption() const
#define Assert(cond, exc)
std::vector< types::global_dof_index > component_start
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
virtual void prolongate(const unsigned int to_level, Vector< number > &dst, const Vector< number > &src) const override
std::vector< std::vector< types::global_dof_index > > sizes
std::vector< std::shared_ptr< BlockSparseMatrix< double > > > prolongation_matrices
std::vector< std::shared_ptr< BlockSparsityPattern > > prolongation_sparsities
std::vector< unsigned int > mg_block
void initialize(const std::vector< number > &factors, VectorMemory< Vector< number >> &memory)
#define DEAL_II_NAMESPACE_CLOSE
BlockType & block(const unsigned int i)