16 #ifndef dealii_mg_transfer_h 17 #define dealii_mg_transfer_h 48 template <
typename VectorType>
56 template <
typename SparsityPatternType,
typename DoFHandlerType>
61 const SparsityPatternType &sp,
62 const DoFHandlerType &)
70 #ifdef DEAL_II_WITH_TRILINOS 71 template <
typename Number>
79 template <
typename SparsityPatternType,
typename DoFHandlerType>
84 const SparsityPatternType &sp,
87 const ::parallel::TriangulationBase<DoFHandlerType::dimension,
88 DoFHandlerType::space_dimension>
90 DoFHandlerType::dimension,
91 DoFHandlerType::space_dimension
> *>(&(dh.get_triangulation()));
92 MPI_Comm communicator =
95 matrix.
reinit(dh.locally_owned_mg_dofs(level + 1),
96 dh.locally_owned_mg_dofs(level),
111 template <
typename SparsityPatternType,
typename DoFHandlerType>
116 const SparsityPatternType &sp,
119 const ::parallel::TriangulationBase<DoFHandlerType::dimension,
120 DoFHandlerType::space_dimension>
122 DoFHandlerType::dimension,
123 DoFHandlerType::space_dimension
> *>(&(dh.get_triangulation()));
124 MPI_Comm communicator =
126 matrix.
reinit(dh.locally_owned_mg_dofs(level + 1),
127 dh.locally_owned_mg_dofs(level),
134 # ifdef DEAL_II_WITH_MPI 135 # ifdef DEAL_II_TRILINOS_WITH_TPETRA 136 template <
typename Number>
144 template <
typename SparsityPatternType,
typename DoFHandlerType>
149 const SparsityPatternType &sp,
152 const ::parallel::TriangulationBase<DoFHandlerType::dimension,
153 DoFHandlerType::space_dimension>
155 DoFHandlerType::dimension,
156 DoFHandlerType::space_dimension
> *>(&(dh.get_triangulation()));
157 MPI_Comm communicator =
159 matrix.
reinit(dh.locally_owned_mg_dofs(level + 1),
160 dh.locally_owned_mg_dofs(level),
176 template <
typename SparsityPatternType,
typename DoFHandlerType>
181 const SparsityPatternType &sp,
184 const ::parallel::TriangulationBase<DoFHandlerType::dimension,
185 DoFHandlerType::space_dimension>
187 DoFHandlerType::dimension,
188 DoFHandlerType::space_dimension
> *>(&(dh.get_triangulation()));
189 MPI_Comm communicator =
191 matrix.
reinit(dh.locally_owned_mg_dofs(level + 1),
192 dh.locally_owned_mg_dofs(level),
202 template <
typename Number>
210 template <
typename SparsityPatternType,
typename DoFHandlerType>
215 const SparsityPatternType &,
216 const DoFHandlerType &)
221 "ERROR: MGTransferPrebuilt with LinearAlgebra::distributed::Vector currently " 222 "needs deal.II to be configured with Trilinos."));
228 #ifdef DEAL_II_WITH_PETSC 237 template <
typename SparsityPatternType,
typename DoFHandlerType>
242 const SparsityPatternType &sp,
243 const DoFHandlerType & dh)
245 const ::parallel::TriangulationBase<DoFHandlerType::dimension,
246 DoFHandlerType::space_dimension>
248 DoFHandlerType::dimension,
249 DoFHandlerType::space_dimension
> *>(&(dh.get_triangulation()));
250 MPI_Comm communicator =
253 matrix.
reinit(dh.locally_owned_mg_dofs(level + 1),
254 dh.locally_owned_mg_dofs(level),
278 template <
typename VectorType>
294 template <
int dim,
class InVector,
int spacedim>
298 const InVector & src)
const;
307 template <
int dim,
class OutVector,
int spacedim>
318 template <
int dim,
class OutVector,
int spacedim>
340 set_component_to_block_map(
const std::vector<unsigned int> &map);
352 print_indices(std::ostream &os)
const;
358 template <
int dim,
int spacedim>
360 fill_and_communicate_copy_indices(
366 std::vector<types::global_dof_index>
sizes;
376 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
387 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
398 std::vector<std::pair<types::global_dof_index, types::global_dof_index>>>
425 template <
int dim,
int spacedim>
443 template <
typename Number>
445 :
public MGTransferBase<LinearAlgebra::distributed::Vector<Number>>
460 template <
int dim,
typename Number2,
int spacedim>
473 template <
int dim,
typename Number2,
int spacedim>
485 template <
int dim,
typename Number2,
int spacedim>
508 set_component_to_block_map(
const std::vector<unsigned int> &map);
520 print_indices(std::ostream &os)
const;
527 template <
int dim,
typename Number2,
int spacedim>
532 const bool solution_transfer)
const;
537 template <
int dim,
int spacedim>
539 fill_and_communicate_copy_indices(
545 std::vector<types::global_dof_index>
sizes;
650 template <
int dim,
int spacedim>
670 template <
typename VectorType>
707 template <
int dim,
int spacedim>
716 template <
int dim,
int spacedim>
732 prolongate(
const unsigned int to_level,
752 restrict_and_add(
const unsigned int from_level,
776 print_matrices(std::ostream &os)
const;
783 std::shared_ptr<typename internal::MatrixSelector<VectorType>::Sparsity>>
792 std::shared_ptr<typename internal::MatrixSelector<VectorType>::Matrix>>
std::vector< Table< 2, unsigned int > > copy_indices_global_mine
std::vector< std::vector< std::pair< types::global_dof_index, types::global_dof_index > > > copy_indices
static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const SparsityPatternType &sp, const DoFHandlerType &)
Contents is actually a matrix.
LinearAlgebra::distributed::Vector< Number > solution_ghosted_global_vector
std::vector< Table< 2, unsigned int > > solution_copy_indices_level_mine
std::vector< types::global_dof_index > sizes
std::vector< Table< 2, unsigned int > > copy_indices
#define AssertThrow(cond, exc)
std::vector< unsigned int > component_to_block_map
LinearAlgebra::distributed::Vector< Number > ghosted_global_vector
virtual void reinit(const SparsityPattern &sparsity)
std::vector< Table< 2, unsigned int > > solution_copy_indices_global_mine
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, DoFHandlerType &dh)
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, DoFHandlerType &dh)
std::vector< std::vector< std::pair< types::global_dof_index, types::global_dof_index > > > copy_indices_level_mine
std::vector< Table< 2, unsigned int > > copy_indices_level_mine
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, DoFHandlerType &dh)
#define DeclException0(Exception0)
bool perform_renumbered_plain_copy
#define DEAL_II_NAMESPACE_CLOSE
std::vector< unsigned int > component_to_block_map
std::vector< std::vector< std::pair< types::global_dof_index, types::global_dof_index > > > copy_indices_global_mine
SmartPointer< const MGConstrainedDoFs, MGLevelGlobalTransfer< VectorType > > mg_constrained_dofs
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, DoFHandlerType &dh)
void copy_from(const size_type n_rows, const size_type n_cols, const ForwardIterator begin, const ForwardIterator end)
SparseMatrix< double > SparseMatrix
std::vector< std::shared_ptr< typename internal::MatrixSelector< VectorType >::Sparsity > > prolongation_sparsities
virtual const MPI_Comm & get_communicator() const
void reinit(const MPI_Comm &communicator, const size_type m, const size_type n, const size_type local_rows, const size_type local_columns, const size_type n_nonzero_per_row, const bool is_symmetric=false, const size_type n_offdiag_nonzero_per_row=0)
std::vector< types::global_dof_index > sizes
SmartPointer< const MGConstrainedDoFs, MGLevelGlobalTransfer< LinearAlgebra::distributed::Vector< Number > > > mg_constrained_dofs
void reinit(const SparsityPatternType &sparsity_pattern)
#define DEAL_II_NAMESPACE_OPEN
MGLevelObject< LinearAlgebra::distributed::Vector< Number > > solution_ghosted_level_vector
std::vector< Table< 2, unsigned int > > solution_copy_indices
static ::ExceptionBase & ExcNotImplemented()
std::vector< std::vector< bool > > interface_dofs
std::vector< std::shared_ptr< typename internal::MatrixSelector< VectorType >::Matrix > > prolongation_matrices
#define DEAL_II_DEPRECATED
MGLevelObject< LinearAlgebra::distributed::Vector< Number > > ghosted_level_vector
static const bool requires_distributed_sparsity_pattern
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, const DoFHandlerType &dh)