template <typename SparsityPatternType, typename DoFHandlerType>
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, DoFHandlerType &dh)
{
+ const parallel::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *dist_tria =
+ dynamic_cast<const parallel::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
+ (&(dh.get_triangulation()));
+ MPI_Comm communicator = dist_tria != nullptr ?
+ dist_tria->get_communicator() :
+ MPI_COMM_SELF;
+
matrix.reinit(dh.locally_owned_mg_dofs(level+1),
dh.locally_owned_mg_dofs(level),
- sp, MPI_COMM_WORLD, true);
+ sp, communicator, true);
}
};
template <typename SparsityPatternType, typename DoFHandlerType>
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, DoFHandlerType &dh)
{
+ const parallel::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *dist_tria =
+ dynamic_cast<const parallel::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
+ (&(dh.get_triangulation()));
+ MPI_Comm communicator = dist_tria != nullptr ?
+ dist_tria->get_communicator() :
+ MPI_COMM_SELF;
matrix.reinit(dh.locally_owned_mg_dofs(level+1),
dh.locally_owned_mg_dofs(level),
- sp, MPI_COMM_WORLD, true);
+ sp, communicator, true);
}
};
template <typename SparsityPatternType, typename DoFHandlerType>
static void reinit(Matrix &matrix, Sparsity &, int level, const SparsityPatternType &sp, DoFHandlerType &dh)
{
+ const parallel::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension> *dist_tria =
+ dynamic_cast<const parallel::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
+ (&(dh.get_triangulation()));
+ MPI_Comm communicator = dist_tria != nullptr ?
+ dist_tria->get_communicator() :
+ MPI_COMM_SELF;
matrix.reinit(dh.locally_owned_mg_dofs(level+1),
dh.locally_owned_mg_dofs(level),
- sp, MPI_COMM_WORLD, true);
+ sp, communicator, true);
}
};
#endif