Skip to content

Commit

Permalink
Use new compute_locally_owned_dofs_per_processor
Browse files Browse the repository at this point in the history
  • Loading branch information
kronbichler committed Jun 3, 2019
1 parent d12ab54 commit c6e7db3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
26 changes: 14 additions & 12 deletions source/dofs/dof_renumbering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1372,21 +1372,23 @@ namespace DoFRenumbering
dynamic_cast<const parallel::Triangulation<dim, spacedim> *>(
&dof_handler.get_triangulation()))
{
const std::vector<types::global_dof_index>
&n_locally_owned_dofs_per_processor =
dof_handler.n_locally_owned_dofs_per_processor();
my_starting_index =
std::accumulate(n_locally_owned_dofs_per_processor.begin(),
n_locally_owned_dofs_per_processor.begin() +
tria->locally_owned_subdomain(),
types::global_dof_index(0));
#ifdef DEAL_II_WITH_MPI
types::global_dof_index local_size =
dof_handler.locally_owned_dofs().n_elements();
MPI_Exscan(&local_size,
&my_starting_index,
1,
DEAL_II_DOF_INDEX_MPI_TYPE,
MPI_SUM,
tria->get_communicator());
#endif
}

if (const parallel::distributed::Triangulation<dim, spacedim> *tria =
dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim>
*>(&dof_handler.get_triangulation()))
{
#ifdef DEAL_II_WITH_P4EST
# ifdef DEAL_II_WITH_P4EST
// this is a distributed Triangulation. we need to traverse the coarse
// cells in the order p4est does to match the z-order actually used
// by p4est. this requires using the renumbering of coarse cells
Expand All @@ -1406,9 +1408,9 @@ namespace DoFRenumbering
locally_owned,
renumbering);
}
#else
# else
Assert(false, ExcNotImplemented());
#endif
# endif
}
else
{
Expand Down Expand Up @@ -2259,7 +2261,7 @@ namespace DoFRenumbering


/*-------------- Explicit Instantiations -------------------------------*/
#include "dof_renumbering.inst"
# include "dof_renumbering.inst"


DEAL_II_NAMESPACE_CLOSE
2 changes: 1 addition & 1 deletion source/multigrid/mg_transfer_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ namespace internal
locally_owned_mg_dofs_per_processor;
for (unsigned int l = 0; l < tria->n_global_levels(); ++l)
locally_owned_mg_dofs_per_processor.push_back(
mg_dof.locally_owned_mg_dofs_per_processor(l));
mg_dof.compute_locally_owned_mg_dofs_per_processor(l));

const std::set<types::subdomain_id> &neighbors =
tria->level_ghost_owners();
Expand Down
2 changes: 1 addition & 1 deletion source/multigrid/mg_transfer_prebuilt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ MGTransferPrebuilt<VectorType>::build_matrices(
// Compute # of locally owned MG dofs / processor for distribution
const std::vector<::dealii::IndexSet>
locally_owned_mg_dofs_per_processor =
mg_dof.locally_owned_mg_dofs_per_processor(level + 1);
mg_dof.compute_locally_owned_mg_dofs_per_processor(level + 1);
std::vector<::dealii::types::global_dof_index>
n_locally_owned_mg_dofs_per_processor(
locally_owned_mg_dofs_per_processor.size(), 0);
Expand Down

0 comments on commit c6e7db3

Please sign in to comment.