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>
132 template <
typename SparsityPatternType,
int dim,
int spacedim>
137 const SparsityPatternType &sp,
159 template <
typename SparsityPatternType,
int dim,
int spacedim>
164 const SparsityPatternType &sp,
180 template <
typename Number>
181 struct MatrixSelector<
LinearAlgebra::distributed::Vector<Number>>
188 template <
typename SparsityPatternType,
int dim,
int spacedim>
193 const SparsityPatternType &,
199 "ERROR: MGTransferPrebuilt with LinearAlgebra::distributed::Vector currently "
200 "needs deal.II to be configured with Trilinos."));
206#ifdef DEAL_II_WITH_PETSC
215 template <
typename SparsityPatternType,
int dim,
int spacedim>
220 const SparsityPatternType &sp,
248template <
typename VectorType>
264 template <
int dim,
class InVector,
int spacedim>
268 const InVector &src)
const;
277 template <
int dim,
class OutVector,
int spacedim>
288 template <
int dim,
class OutVector,
int spacedim>
328 template <
int dim,
int spacedim>
336 std::vector<types::global_dof_index>
sizes;
346 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
357 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
368 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
394 template <
int dim,
int spacedim>
409template <
typename Number>
411 :
public MGTransferBase<LinearAlgebra::distributed::Vector<Number>>
426 template <
int dim,
typename Number2,
int spacedim>
439 template <
int dim,
typename Number2,
int spacedim>
451 template <
int dim,
typename Number2,
int spacedim>
493 template <
int dim,
typename Number2,
int spacedim>
498 const bool solution_transfer)
const;
503 template <
int dim,
int spacedim>
511 std::vector<types::global_dof_index>
sizes;
601 std::function<void(
const unsigned int,
609 template <
int dim,
int spacedim>
626template <
typename VectorType>
663 template <
int dim,
int spacedim>
681 const VectorType &src)
const override;
701 const VectorType &src)
const override;
730 std::shared_ptr<typename internal::MatrixSelector<VectorType>::Sparsity>>
739 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
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
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
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
SmartPointer< const MGConstrainedDoFs > mg_constrained_dofs
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
SmartPointer< const MGConstrainedDoFs > mg_constrained_dofs
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 > &)