16#ifndef dealii_distributed_cell_data_transfer_h
17#define dealii_distributed_cell_data_transfer_h
27#include <boost/range/iterator_range.hpp>
126 template <
int dim,
int spacedim = dim,
typename VectorType = Vector<
double>>
157 const VectorType &input_vector)
159 const typename VectorType::value_type value =
160 input_vector[parent->child(0)->active_cell_index()];
162 for (
unsigned int child_index = 1; child_index < parent->n_children();
166 input_vector[parent->child(child_index)->active_cell_index()],
168 "Values on cells that will be coarsened are not equal!"));
180 cell_iterator & parent,
181 const VectorType &input_vector)
183 typename VectorType::value_type
sum = 0;
185 for (
unsigned int child_index = 0; child_index < parent->n_children();
188 input_vector[parent->child(child_index)->active_cell_index()];
201 const VectorType & input_vector)
203 return sum(parent, input_vector) / parent->n_children();
226 const std::function<std::vector<value_type>(
227 const typename ::Triangulation<dim, spacedim>::cell_iterator
230 &::AdaptationStrategies::Refinement::
231 preserve<dim, spacedim, value_type>,
233 const typename ::Triangulation<dim, spacedim>::cell_iterator
236 &::AdaptationStrategies::Coarsening::
237 check_equality<dim, spacedim, value_type>);
283 const std::vector<const VectorType *> &all_in);
315 unpack(std::vector<VectorType *> &all_out);
347 const std::function<std::vector<value_type>(
358 const std::vector<value_type> &children_values)>
402 const boost::iterator_range<std::vector<char>::const_iterator>
404 std::vector<VectorType *> &all_out);
void unpack(VectorType &out)
void prepare_for_serialization(const VectorType &in)
void prepare_for_serialization(const std::vector< const VectorType * > &all_in)
SmartPointer< const parallel::distributed::Triangulation< dim, spacedim >, CellDataTransfer< dim, spacedim, VectorType > > triangulation
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)
void unpack(std::vector< VectorType * > &all_out)
void prepare_for_coarsening_and_refinement(const VectorType &in)
void deserialize(VectorType &out)
CellDataTransfer(const parallel::distributed::Triangulation< dim, spacedim > &triangulation, const bool transfer_variable_size_data=false, const std::function< std::vector< value_type >(const typename ::Triangulation< dim, spacedim >::cell_iterator &parent, const value_type parent_value)> refinement_strategy=&::AdaptationStrategies::Refinement::preserve< dim, spacedim, value_type >, const std::function< value_type(const typename ::Triangulation< dim, spacedim >::cell_iterator &parent, const std::vector< value_type > &children_values)> coarsening_strategy=&::AdaptationStrategies::Coarsening::check_equality< dim, spacedim, value_type >)
void deserialize(std::vector< VectorType * > &all_out)
void register_data_attach()
void prepare_for_coarsening_and_refinement(const std::vector< const VectorType * > &all_in)
const std::function< value_type(const typename Triangulation< dim, spacedim >::cell_iterator &parent, const std::vector< value_type > &children_values)> coarsening_strategy
const std::function< std::vector< value_type >(const typename Triangulation< dim, spacedim >::cell_iterator &parent, const value_type parent_value)> refinement_strategy
const bool transfer_variable_size_data
std::vector< char > pack_callback(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &cell, const typename parallel::distributed::Triangulation< dim, spacedim >::CellStatus status)
std::vector< const VectorType * > input_vectors
void unpack_callback(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &cell, const typename parallel::distributed::Triangulation< dim, spacedim >::CellStatus status, const boost::iterator_range< std::vector< char >::const_iterator > &data_range, std::vector< VectorType * > &all_out)
typename VectorType::value_type value_type
#define DEAL_II_DEPRECATED
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
T sum(const T &t, const MPI_Comm &mpi_communicator)
static VectorType::value_type sum(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)
static VectorType::value_type mean(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)
static VectorType::value_type check_equality(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)