16#ifndef dealii_mg_transfer_h
17#define dealii_mg_transfer_h
48 template <
typename VectorType>
56 template <
typename SparsityPatternType,
int dim,
int spacedim>
61 const SparsityPatternType &sp,
66 matrix.reinit(sparsity);
70#ifdef DEAL_II_WITH_TRILINOS
71 template <
typename Number>
79 template <
typename SparsityPatternType,
int dim,
int spacedim>
84 const SparsityPatternType & sp,
105 template <
typename SparsityPatternType,
int dim,
int spacedim>
110 const SparsityPatternType & sp,
123# ifdef DEAL_II_WITH_MPI
124# ifdef DEAL_II_TRILINOS_WITH_TPETRA
125 template <
typename Number>
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>>>
396 template <
int dim,
int spacedim>
411template <
typename Number>
413 :
public MGTransferBase<LinearAlgebra::distributed::Vector<Number>>
428 template <
int dim,
typename Number2,
int spacedim>
441 template <
int dim,
typename Number2,
int spacedim>
453 template <
int dim,
typename Number2,
int spacedim>
495 template <
int dim,
typename Number2,
int spacedim>
500 const bool solution_transfer)
const;
505 template <
int dim,
int spacedim>
513 std::vector<types::global_dof_index>
sizes;
617 std::function<void(
const unsigned int,
625 template <
int dim,
int spacedim>
642template <
typename VectorType>
679 template <
int dim,
int spacedim>
697 const VectorType & src)
const override;
717 const VectorType & src)
const override;
746 std::shared_ptr<typename internal::MatrixSelector<VectorType>::Sparsity>>
755 std::shared_ptr<typename internal::MatrixSelector<VectorType>::Matrix>>
const IndexSet & locally_owned_mg_dofs(const unsigned int level) const
MPI_Comm get_communicator() const
void copy_from_mg(const DoFHandler< dim, spacedim > &dof_handler, LinearAlgebra::distributed::Vector< Number2 > &dst, const MGLevelObject< LinearAlgebra::distributed::Vector< Number > > &src) const
SmartPointer< const MGConstrainedDoFs, MGLevelGlobalTransfer< LinearAlgebra::distributed::Vector< Number > > > mg_constrained_dofs
std::vector< Table< 2, unsigned int > > solution_copy_indices_level_mine
std::vector< Table< 2, unsigned int > > copy_indices
std::vector< types::global_dof_index > sizes
void copy_to_mg(const DoFHandler< dim, spacedim > &dof_handler, MGLevelObject< LinearAlgebra::distributed::Vector< Number > > &dst, const LinearAlgebra::distributed::Vector< Number2 > &src) const
MGLevelObject< LinearAlgebra::distributed::Vector< Number > > ghosted_level_vector
void set_component_to_block_map(const std::vector< unsigned int > &map)
void copy_from_mg_add(const DoFHandler< dim, spacedim > &dof_handler, LinearAlgebra::distributed::Vector< Number2 > &dst, const MGLevelObject< LinearAlgebra::distributed::Vector< Number > > &src) const
std::vector< Table< 2, unsigned int > > solution_copy_indices
std::vector< Table< 2, unsigned int > > solution_copy_indices_global_mine
bool perform_renumbered_plain_copy
LinearAlgebra::distributed::Vector< Number > solution_ghosted_global_vector
void copy_to_mg(const DoFHandler< dim, spacedim > &dof_handler, MGLevelObject< LinearAlgebra::distributed::Vector< Number > > &dst, const LinearAlgebra::distributed::Vector< Number2 > &src, const bool solution_transfer) const
void assert_built(const DoFHandler< dim, spacedim > &dof_handler) const
std::vector< Table< 2, unsigned int > > copy_indices_global_mine
MGLevelObject< LinearAlgebra::distributed::Vector< Number > > solution_ghosted_level_vector
LinearAlgebra::distributed::Vector< Number > ghosted_global_vector
std::vector< unsigned int > component_to_block_map
std::function< void(const unsigned int, LinearAlgebra::distributed::Vector< Number > &)> initialize_dof_vector
std::vector< Table< 2, unsigned int > > copy_indices_level_mine
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)
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
SmartPointer< const MGConstrainedDoFs, MGLevelGlobalTransfer< VectorType > > mg_constrained_dofs
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