/**
* Go through all locally owned cells and store the relations between
- * cells and their status in the private member local_cell_relations.
+ * cells and their CellStatus in the private member local_cell_relations.
*
* The stored vector will be ordered by the occurrence of cells.
*/
#include <functional>
#include <list>
#include <set>
-#include <tuple>
#include <utility>
#include <vector>
#include <functional>
#include <list>
#include <set>
-#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
typename dealii::internal::p4est::types<dim>::ghost *parallel_ghost;
/**
- * Go through all p4est trees and store the relations between the status
- * of locally owned quadrants and cells in the private member
+ * Go through all p4est trees and store the relations between a deal.II
+ * cell and its current CellStatus in the private member
* local_cell_relations.
*
* The stored vector will be ordered by the occurrence of quadrants in
#include <functional>
#include <list>
#include <set>
-#include <tuple>
#include <utility>
#include <vector>
const unsigned int n_attached_deserialize_variable);
/**
- * Go through all cells and store the relations between locally
- * owned quadrants and cells in the private member
- * local_cell_relations.
+ * Go through all cells and store the relations between a deal.II cell and
+ * its current CellStatus in the private member local_cell_relations.
+ * For an extensive description of CellStatus, see the documentation
+ * for the member function register_data_attach().
*
* The stored vector will be ordered by the occurrence of quadrants.
*/
* description of the latter, see the documentation for the member
* function register_data_attach().
*/
- using cell_relation_t = typename std::tuple<CellStatus, cell_iterator>;
+ using cell_relation_t = typename std::pair<cell_iterator, CellStatus>;
/**
- * Vector of tuples, which each contain a deal.II cell
+ * Vector of pair, each containing a deal.II cell iterator
* and their relation after refinement. To update its contents, use the
- * compute_cell_relations member function.
+ * update_cell_relations() member function.
*
* The size of this vector is assumed to be equal to the number of locally
* owned quadrants in the parallel_forest object.
continue;
this->local_cell_relations[cell_id] =
- std::make_tuple(Triangulation<dim, spacedim>::CELL_PERSIST, cell);
+ std::make_pair(cell, Triangulation<dim, spacedim>::CELL_PERSIST);
++cell_id;
}
}
}
template <int dim, int spacedim>
- using cell_relation_t = typename std::tuple<
- typename dealii::Triangulation<dim, spacedim>::CellStatus,
- typename dealii::Triangulation<dim, spacedim>::cell_iterator>;
+ using cell_relation_t = typename std::pair<
+ typename dealii::Triangulation<dim, spacedim>::cell_iterator,
+ typename dealii::Triangulation<dim, spacedim>::CellStatus>;
/**
- * Adds a tuple of a p4est quadrant, @p status and @p dealii_cell
+ * Adds a pair of a @p dealii_cell and its @p status
* to the vector containing all relations @p cell_rel.
- * The tuple will be inserted in the position corresponding to the one
+ * The pair will be inserted in the position corresponding to the one
* of the p4est quadrant in the underlying p4est sc_array. The position
* will be determined from @p idx, which is the position of the quadrant
* in its corresponding @p tree. The p4est quadrant will be deduced from
Assert(local_quadrant_index < cell_rel.size(), ExcInternalError());
// store relation
- cell_rel[local_quadrant_index] = std::make_tuple(status, dealii_cell);
+ cell_rel[local_quadrant_index] = std::make_pair(dealii_cell, status);
}
else if (!p4est_has_children && !dealii_cell->has_children())
{
// this active cell didn't change
- // save tuple into corresponding position
+ // save pair into corresponding position
add_single_cell_relation<dim, spacedim>(
cell_rel,
tree,
{
(void)cell_rel;
Assert(
- (std::get<0>(cell_rel) == // cell_status
+ (cell_rel.second == // cell_status
parallel::distributed::Triangulation<dim, spacedim>::CELL_PERSIST),
ExcInternalError());
}
// in the same order p4est will encounter them during repartitioning.
for (const auto &cell_rel : this->local_cell_relations)
{
- const auto &cell_status = std::get<0>(cell_rel);
- const auto &cell_it = std::get<1>(cell_rel);
+ const auto &cell_it = cell_rel.first;
+ const auto &cell_status = cell_rel.second;
switch (cell_status)
{
{
(void)cell_rel;
Assert(
- (std::get<0>(cell_rel) == // cell_status
+ (cell_rel.second == // cell_status
parallel::DistributedTriangulationBase<dim,
spacedim>::CELL_PERSIST),
ExcInternalError());
{
// reset all cell_status entries after coarsening/refinement
for (auto &cell_rel : local_cell_relations)
- std::get<0>(cell_rel) =
+ cell_rel.second =
parallel::DistributedTriangulationBase<dim, spacedim>::CELL_PERSIST;
}
}
auto data_cell_variable_it = packed_variable_size_data.begin();
for (; cell_rel_it != cell_relations.cend(); ++cell_rel_it)
{
- const auto &cell_status = std::get<0>(*cell_rel_it);
- const auto &dealii_cell = std::get<1>(*cell_rel_it);
+ const auto &dealii_cell = cell_rel_it->first;
+ const auto &cell_status = cell_rel_it->second;
// Assertions about the tree structure.
switch (cell_status)
for (; cell_rel_it != cell_relations.end();
++cell_rel_it, dest_fixed_it += sizes_fixed_cumulative.back())
{
- std::get<0>(*cell_rel_it) = // cell_status
+ cell_rel_it->second = // cell_status
Utilities::unpack<typename parallel::DistributedTriangulationBase<
dim,
spacedim>::CellStatus>(dest_fixed_it,
auto dest_sizes_it = dest_sizes_variable.cbegin();
for (; cell_rel_it != cell_relations.end(); ++cell_rel_it)
{
- const auto &cell_status = std::get<0>(*cell_rel_it);
- const auto &dealii_cell = std::get<1>(*cell_rel_it);
+ const auto &dealii_cell = cell_rel_it->first;
+ const auto &cell_status = cell_rel_it->second;
if (callback_variable_transfer)
{