16 #ifndef dealii_mg_transfer_block_h 17 #define dealii_mg_transfer_block_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/mg_level_object.h> 23 #include <deal.II/dofs/dof_handler.h> 25 #include <deal.II/lac/block_matrix_array.h> 26 #include <deal.II/lac/block_sparsity_pattern.h> 27 #include <deal.II/lac/block_vector.h> 28 #include <deal.II/lac/sparsity_pattern.h> 29 #include <deal.II/lac/vector_memory.h> 31 #include <deal.II/multigrid/mg_base.h> 32 #include <deal.II/multigrid/mg_constrained_dofs.h> 37 DEAL_II_NAMESPACE_OPEN
40 template <
int dim,
int spacedim>
97 template <
int dim,
int spacedim>
130 mutable std::vector<std::vector<types::global_dof_index>>
sizes;
148 std::vector<std::shared_ptr<BlockSparsityPattern>> prolongation_sparsities;
164 std::vector<std::vector<std::vector<std::pair<unsigned int, unsigned int>>>>
194 template <
typename number>
223 template <
int dim,
int spacedim>
227 const std::vector<bool> &
selected);
250 template <
int dim,
typename number2,
int spacedim>
262 template <
int dim,
typename number2,
int spacedim>
273 template <
int dim,
typename number2,
int spacedim>
310 template <
typename number>
352 template <
int dim,
int spacedim>
362 select(
const unsigned int block);
380 template <
int dim,
typename number2,
int spacedim>
384 const Vector<number2> & src)
const;
392 template <
int dim,
typename number2,
int spacedim>
395 Vector<number2> & dst,
403 template <
int dim,
typename number2,
int spacedim>
406 Vector<number2> & dst,
416 template <
int dim,
typename number2,
int spacedim>
428 template <
int dim,
typename number2,
int spacedim>
439 template <
int dim,
typename number2,
int spacedim>
455 template <
int dim,
class OutVector,
int spacedim>
460 const unsigned int offset)
const;
465 template <
int dim,
class OutVector,
int spacedim>
470 const unsigned int offset)
const;
475 template <
int dim,
class InVector,
int spacedim>
479 const InVector & src,
480 const unsigned int offset)
const;
490 template <
typename number>
494 selected_block = block;
497 DEAL_II_NAMESPACE_CLOSE
void build_matrices(const DoFHandler< dim, spacedim > &dof, const DoFHandler< dim, spacedim > &mg_dof)
std::size_t memory_consumption() const
virtual ~MGTransferBlock() override
virtual void prolongate(const unsigned int to_level, Vector< number > &dst, const Vector< number > &src) const override
std::vector< types::global_dof_index > block_start
void do_copy_from_mg_add(const DoFHandler< dim, spacedim > &mg_dof, OutVector &dst, const MGLevelObject< Vector< number >> &src, const unsigned int offset) const
SmartPointer< const MGConstrainedDoFs, MGTransferBlockBase > mg_constrained_dofs
virtual ~MGTransferBlockSelect() override=default
void do_copy_from_mg(const DoFHandler< dim, spacedim > &mg_dof, OutVector &dst, const MGLevelObject< Vector< number >> &src, const unsigned int offset) const
std::vector< std::vector< types::global_dof_index > > sizes
std::vector< std::shared_ptr< BlockSparseMatrix< double > > > prolongation_matrices
void copy_from_mg(const DoFHandler< dim, spacedim > &mg_dof, Vector< number2 > &dst, const MGLevelObject< Vector< number >> &src) const
#define DeclException0(Exception0)
virtual void restrict_and_add(const unsigned int from_level, BlockVector< number > &dst, const BlockVector< number > &src) const override
virtual void restrict_and_add(const unsigned int from_level, Vector< number > &dst, const Vector< number > &src) const override
void copy_from_mg_add(const DoFHandler< dim, spacedim > &mg_dof, BlockVector< number2 > &dst, const MGLevelObject< BlockVector< number >> &src) const
void select(const unsigned int block)
std::vector< std::vector< std::vector< std::pair< unsigned int, unsigned int > > > > copy_indices
std::vector< unsigned int > mg_block
static ::ExceptionBase & ExcMatricesNotBuilt()
void do_copy_to_mg(const DoFHandler< dim, spacedim > &mg_dof, MGLevelObject< Vector< number >> &dst, const InVector &src, const unsigned int offset) const
void build_matrices(const DoFHandler< dim, spacedim > &dof, const DoFHandler< dim, spacedim > &mg_dof, unsigned int selected)
std::vector< std::vector< types::global_dof_index > > mg_block_start
void copy_from_mg(const DoFHandler< dim, spacedim > &mg_dof, BlockVector< number2 > &dst, const MGLevelObject< BlockVector< number >> &src) const
void copy_to_mg(const DoFHandler< dim, spacedim > &mg_dof, MGLevelObject< Vector< number >> &dst, const Vector< number2 > &src) const
std::size_t memory_consumption() const
void build_matrices(const DoFHandler< dim, spacedim > &dof, const DoFHandler< dim, spacedim > &mg_dof, const std::vector< bool > &selected)
SmartPointer< VectorMemory< Vector< number > >, MGTransferBlock< number > > memory
std::vector< number > factors
void copy_to_mg(const DoFHandler< dim, spacedim > &mg_dof, MGLevelObject< BlockVector< number >> &dst, const BlockVector< number2 > &src) const
virtual void prolongate(const unsigned int to_level, BlockVector< number > &dst, const BlockVector< number > &src) const override
void initialize(const std::vector< number > &factors, VectorMemory< Vector< number >> &memory)
std::vector< bool > selected
unsigned int selected_block
void copy_from_mg_add(const DoFHandler< dim, spacedim > &mg_dof, Vector< number2 > &dst, const MGLevelObject< Vector< number >> &src) const