using value_type = typename VectorType::value_type;
public:
- /**
- * When data is transferred during coarsening, it is not trivial to decide
- * how to handle data of child cells which will be coarsened. Or in other
- * words, which data should be stored in the corresponding parent cell.
- *
- * In this struct, we offer a few strategies that cope with this
- * problem. Such strategies can be passed to the CellDataTransfer and
- * parallel::distributed::CellDataTransfer constructors.
- *
- * @deprecated Use the namespace dealii::AdaptationStrategies::Coarsening instead.
- */
- struct DEAL_II_DEPRECATED CoarseningStrategies
- {
- /**
- * @copydoc dealii::AdaptationStrategies::Coarsening::check_equality()
- *
- * @deprecated Use dealii::AdaptationStrategies::Coarsening::check_equality() instead.
- */
- DEAL_II_DEPRECATED static typename VectorType::value_type
- check_equality(const typename parallel::distributed::
- Triangulation<dim, spacedim>::cell_iterator &parent,
- const VectorType &input_vector)
- {
- const typename VectorType::value_type value =
- input_vector[parent->child(0)->active_cell_index()];
-
- for (unsigned int child_index = 1; child_index < parent->n_children();
- ++child_index)
- Assert(
- value ==
- input_vector[parent->child(child_index)->active_cell_index()],
- ExcMessage(
- "Values on cells that will be coarsened are not equal!"));
-
- return value;
- }
-
- /**
- * @copydoc dealii::AdaptationStrategies::Coarsening::sum()
- *
- * @deprecated Use dealii::AdaptationStrategies::Coarsening::sum() instead.
- */
- DEAL_II_DEPRECATED static typename VectorType::value_type
- sum(const typename parallel::distributed::Triangulation<dim, spacedim>::
- cell_iterator & parent,
- const VectorType &input_vector)
- {
- typename VectorType::value_type sum = 0;
-
- for (unsigned int child_index = 0; child_index < parent->n_children();
- ++child_index)
- sum +=
- input_vector[parent->child(child_index)->active_cell_index()];
-
- return sum;
- }
-
- /**
- * @copydoc dealii::AdaptationStrategies::Coarsening::mean()
- *
- * @deprecated Use dealii::AdaptationStrategies::Coarsening::mean() instead.
- */
- DEAL_II_DEPRECATED static typename VectorType::value_type
- mean(const typename parallel::distributed::
- Triangulation<dim, spacedim>::cell_iterator &parent,
- const VectorType & input_vector)
- {
- return sum(parent, input_vector) / parent->n_children();
- }
- };
-
/**
* Constructor.
*
&dealii::AdaptationStrategies::Coarsening::
check_equality<dim, spacedim, value_type>);
- /**
- * Constructor.
- *
- * @param[in] triangulation The triangulation on which all operations will
- * happen. At the time when this constructor is called, the refinement
- * in question has not happened yet.
- * @param[in] transfer_variable_size_data Specify whether your VectorType
- * container stores values that differ in size. A varying amount of data
- * may be packed per cell, if for example the underlying ValueType of
- * the VectorType container is a container itself.
- * @param[in] coarsening_strategy %Function deciding which data to store
- * on a cell whose children will get coarsened into.
- *
- * @deprecated Use the above constructor instead.
- */
- DEAL_II_DEPRECATED
- CellDataTransfer(const parallel::distributed::Triangulation<dim, spacedim>
- & triangulation,
- const bool transfer_variable_size_data,
- const std::function<value_type(
- const typename parallel::distributed::
- Triangulation<dim, spacedim>::cell_iterator &parent,
- const VectorType &input_vector)> coarsening_strategy);
-
/**
* Prepare the current object for coarsening and refinement.
*
, handle(numbers::invalid_unsigned_int)
{}
- template <int dim, int spacedim, typename VectorType>
- DEAL_II_DEPRECATED
- CellDataTransfer<dim, spacedim, VectorType>::CellDataTransfer(
- const parallel::distributed::Triangulation<dim, spacedim> &triangulation,
- const bool transfer_variable_size_data,
- const std::function<
- value_type(const typename parallel::distributed::
- Triangulation<dim, spacedim>::cell_iterator &parent,
- const VectorType &input_vector)> coarsening_strategy)
- : triangulation(&triangulation, typeid(*this).name())
- , transfer_variable_size_data(transfer_variable_size_data)
- , refinement_strategy(&dealii::AdaptationStrategies::Refinement::
- preserve<dim, spacedim, value_type>)
- , handle(numbers::invalid_unsigned_int)
- {
- value_type (*const *old_strategy)(
- const typename parallel::distributed::Triangulation<dim, spacedim>::
- cell_iterator &,
- const VectorType &) =
- coarsening_strategy.template target<
- value_type (*)(const typename parallel::distributed::
- Triangulation<dim, spacedim>::cell_iterator &,
- const VectorType &)>();
-
- if (*old_strategy == CoarseningStrategies::check_equality)
- const_cast<std::function<value_type(
- const typename dealii::Triangulation<dim, spacedim>::cell_iterator &,
- const std::vector<value_type> &)> &>(this->coarsening_strategy) =
- &dealii::AdaptationStrategies::Coarsening::
- check_equality<dim, spacedim, value_type>;
- else if (*old_strategy == CoarseningStrategies::sum)
- const_cast<std::function<value_type(
- const typename dealii::Triangulation<dim, spacedim>::cell_iterator &,
- const std::vector<value_type> &)> &>(this->coarsening_strategy) =
- &dealii::AdaptationStrategies::Coarsening::
- sum<dim, spacedim, value_type>;
- else if (*old_strategy == CoarseningStrategies::mean)
- const_cast<std::function<value_type(
- const typename dealii::Triangulation<dim, spacedim>::cell_iterator &,
- const std::vector<value_type> &)> &>(this->coarsening_strategy) =
- &dealii::AdaptationStrategies::Coarsening::
- mean<dim, spacedim, value_type>;
- else
- Assert(
- false,
- ExcMessage(
- "The constructor using the former function type of the "
- "coarsening_strategy parameter is no longer supported. Please use "
- "the latest function type instead"));
- }
// Interface for packing