15#ifndef dealii_mg_transfer_h
16#define dealii_mg_transfer_h
47 template <
typename VectorType>
55 template <
typename SparsityPatternType,
int dim,
int spacedim>
60 const SparsityPatternType &sp,
65 matrix.reinit(sparsity);
69#ifdef DEAL_II_WITH_TRILINOS
70 template <
typename Number>
78 template <
typename SparsityPatternType,
int dim,
int spacedim>
83 const SparsityPatternType &sp,
104 template <
typename SparsityPatternType,
int dim,
int spacedim>
109 const SparsityPatternType &sp,
122# ifdef DEAL_II_WITH_MPI
123# ifdef DEAL_II_TRILINOS_WITH_TPETRA
124 template <
typename Number,
typename MemorySpace>
133 template <
typename SparsityPatternType,
int dim,
int spacedim>
138 const SparsityPatternType &sp,
160 template <
typename SparsityPatternType,
int dim,
int spacedim>
165 const SparsityPatternType &sp,
181 template <
typename Number>
182 struct MatrixSelector<
LinearAlgebra::distributed::Vector<Number>>
189 template <
typename SparsityPatternType,
int dim,
int spacedim>
194 const SparsityPatternType &,
200 "ERROR: MGTransferPrebuilt with LinearAlgebra::distributed::Vector currently "
201 "needs deal.II to be configured with Trilinos."));
207#ifdef DEAL_II_WITH_PETSC
216 template <
typename SparsityPatternType,
int dim,
int spacedim>
221 const SparsityPatternType &sp,
249template <
typename VectorType>
265 template <
int dim,
class InVector,
int spacedim>
269 const InVector &src)
const;
278 template <
int dim,
class OutVector,
int spacedim>
289 template <
int dim,
class OutVector,
int spacedim>
329 template <
int dim,
int spacedim>
337 std::vector<types::global_dof_index>
sizes;
347 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
358 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
369 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
395 template <
int dim,
int spacedim>
410template <
typename Number,
typename MemorySpace>
414 LinearAlgebra::distributed::Vector<Number, MemorySpace>>
429 template <
int dim,
typename Number2,
int spacedim>
443 template <
int dim,
typename Number2,
int spacedim>
456 template <
int dim,
typename Number2,
int spacedim>
499 template <
int dim,
typename Number2,
int spacedim>
505 const bool solution_transfer)
const;
510 template <
int dim,
int spacedim>
518 std::vector<types::global_dof_index>
sizes;
609 std::function<void(
const unsigned int,
617 template <
int dim,
int spacedim>
634template <
typename VectorType>
671 template <
int dim,
int spacedim>
689 const VectorType &src)
const override;
709 const VectorType &src)
const override;
738 std::shared_ptr<typename internal::MatrixSelector<VectorType>::Sparsity>>
747 std::shared_ptr<typename internal::MatrixSelector<VectorType>::Matrix>>
const IndexSet & locally_owned_mg_dofs(const unsigned int level) const
MPI_Comm get_mpi_communicator() const
void assert_built(const DoFHandler< dim, spacedim > &dof_handler) const
std::vector< Table< 2, unsigned int > > solution_copy_indices_level_mine
std::vector< Table< 2, unsigned int > > copy_indices_level_mine
std::vector< Table< 2, unsigned int > > solution_copy_indices
std::vector< unsigned int > component_to_block_map
ObserverPointer< const MGConstrainedDoFs > mg_constrained_dofs
bool perform_renumbered_plain_copy
LinearAlgebra::distributed::Vector< Number, MemorySpace > ghosted_global_vector
std::function< void(const unsigned int, LinearAlgebra::distributed::Vector< Number, MemorySpace > &)> initialize_dof_vector
void copy_to_mg(const DoFHandler< dim, spacedim > &dof_handler, MGLevelObject< LinearAlgebra::distributed::Vector< Number, MemorySpace > > &dst, const LinearAlgebra::distributed::Vector< Number2, MemorySpace > &src) const
LinearAlgebra::distributed::Vector< Number, MemorySpace > solution_ghosted_global_vector
void copy_to_mg(const DoFHandler< dim, spacedim > &dof_handler, MGLevelObject< LinearAlgebra::distributed::Vector< Number, MemorySpace > > &dst, const LinearAlgebra::distributed::Vector< Number2, MemorySpace > &src, const bool solution_transfer) const
void set_component_to_block_map(const std::vector< unsigned int > &map)
void copy_from_mg(const DoFHandler< dim, spacedim > &dof_handler, LinearAlgebra::distributed::Vector< Number2, MemorySpace > &dst, const MGLevelObject< LinearAlgebra::distributed::Vector< Number, MemorySpace > > &src) const
void copy_from_mg_add(const DoFHandler< dim, spacedim > &dof_handler, LinearAlgebra::distributed::Vector< Number2, MemorySpace > &dst, const MGLevelObject< LinearAlgebra::distributed::Vector< Number, MemorySpace > > &src) const
std::vector< Table< 2, unsigned int > > copy_indices_global_mine
std::vector< types::global_dof_index > sizes
std::vector< Table< 2, unsigned int > > copy_indices
MGLevelObject< LinearAlgebra::distributed::Vector< Number, MemorySpace > > ghosted_level_vector
void print_indices(std::ostream &os) const
void assert_built(const DoFHandler< dim, spacedim > &dof_handler) const
std::vector< std::vector< std::pair< types::global_dof_index, types::global_dof_index > > > copy_indices_level_mine
std::size_t memory_consumption() const
void set_component_to_block_map(const std::vector< unsigned int > &map)
ObserverPointer< const MGConstrainedDoFs > mg_constrained_dofs
std::vector< std::vector< std::pair< types::global_dof_index, types::global_dof_index > > > copy_indices
void fill_and_communicate_copy_indices(const DoFHandler< dim, spacedim > &dof_handler)
std::vector< unsigned int > component_to_block_map
void copy_from_mg_add(const DoFHandler< dim, spacedim > &dof_handler, OutVector &dst, const MGLevelObject< VectorType > &src) const
std::vector< types::global_dof_index > sizes
std::vector< std::vector< std::pair< types::global_dof_index, types::global_dof_index > > > copy_indices_global_mine
void copy_from_mg(const DoFHandler< dim, spacedim > &dof_handler, OutVector &dst, const MGLevelObject< VectorType > &src) const
void copy_to_mg(const DoFHandler< dim, spacedim > &dof_handler, MGLevelObject< VectorType > &dst, const InVector &src) const
virtual ~MGTransferPrebuilt() override=default
std::vector< std::vector< bool > > interface_dofs
virtual void restrict_and_add(const unsigned int from_level, VectorType &dst, const VectorType &src) const override
void build(const DoFHandler< dim, spacedim > &dof_handler)
std::vector< std::shared_ptr< typename internal::MatrixSelector< VectorType >::Sparsity > > prolongation_sparsities
std::size_t memory_consumption() const
MGTransferPrebuilt()=default
virtual void prolongate(const unsigned int to_level, VectorType &dst, const VectorType &src) const override
std::vector< std::shared_ptr< typename internal::MatrixSelector< VectorType >::Matrix > > prolongation_matrices
void print_matrices(std::ostream &os) const
void initialize_constraints(const MGConstrainedDoFs &mg_constrained_dofs)
void copy_from(const size_type n_rows, const size_type n_cols, const ForwardIterator begin, const ForwardIterator end)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
static ::ExceptionBase & ExcMatricesNotBuilt()
static ::ExceptionBase & ExcNoProlongation()
static ::ExceptionBase & ExcNotImplemented()
#define AssertThrow(cond, exc)
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, const DoFHandler< dim, spacedim > &dh)
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, const DoFHandler< dim, spacedim > &dh)
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, const DoFHandler< dim, spacedim > &dh)
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, const DoFHandler< dim, spacedim > &dh)
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, const DoFHandler< dim, spacedim > &dh)
static const bool requires_distributed_sparsity_pattern
static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const SparsityPatternType &sp, const DoFHandler< dim, spacedim > &)
::SparseMatrix< typename VectorType::value_type > Matrix
::SparsityPattern Sparsity