From: Marc Fehling Date: Sat, 6 Mar 2021 04:20:56 +0000 (-0700) Subject: Use correct type for FE indices in DoFH::communicate_active_fe_indices(). X-Git-Tag: v9.3.0-rc1~359^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=538ef0012a8489116311fd4302f6ca03c4d842da;p=dealii.git Use correct type for FE indices in DoFH::communicate_active_fe_indices(). --- diff --git a/source/dofs/dof_handler.cc b/source/dofs/dof_handler.cc index 8d30cbbeff..dc48a04d56 100644 --- a/source/dofs/dof_handler.cc +++ b/source/dofs/dof_handler.cc @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -1715,6 +1716,9 @@ namespace internal dof_handler.hp_capability_enabled == true, (typename DoFHandler::ExcOnlyAvailableWithHP())); + using active_fe_index_type = + typename dealii::DoFHandler::active_fe_index_type; + if (const dealii::parallel::shared::Triangulation *tr = dynamic_cast< const dealii::parallel::shared::Triangulation @@ -1730,8 +1734,8 @@ namespace internal // on the other cells to zero. then we add all of these vectors // up, and because every vector entry has exactly one processor // that owns it, the sum is correct - std::vector active_fe_indices(tr->n_active_cells(), - 0u); + std::vector active_fe_indices( + tr->n_active_cells(), 0u); for (const auto &cell : dof_handler.active_cell_iterators()) if (cell->is_locally_owned()) active_fe_indices[cell->active_cell_index()] = @@ -1766,15 +1770,17 @@ namespace internal // to have functions that can pack and unpack the data we want to // transport -- namely, the single unsigned int active_fe_index // objects - auto pack = [](const typename dealii::DoFHandler:: - active_cell_iterator &cell) -> unsigned int { + auto pack = + [](const typename dealii::DoFHandler:: + active_cell_iterator &cell) -> active_fe_index_type { return cell->active_fe_index(); }; - auto unpack = [&dof_handler]( - const typename dealii::DoFHandler:: - active_cell_iterator &cell, - const unsigned int active_fe_index) -> void { + auto unpack = + [&dof_handler]( + const typename dealii::DoFHandler:: + active_cell_iterator & cell, + const active_fe_index_type active_fe_index) -> void { // we would like to say // cell->set_active_fe_index(active_fe_index); // but this is not allowed on cells that are not @@ -1785,11 +1791,8 @@ namespace internal }; GridTools::exchange_cell_data_to_ghosts< - unsigned int, - dealii::DoFHandler>( - static_cast &>(dof_handler), - pack, - unpack); + active_fe_index_type, + dealii::DoFHandler>(dof_handler, pack, unpack); } else {