16 #ifndef dealii_distributed_cell_data_transfer_h 17 #define dealii_distributed_cell_data_transfer_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/smartpointer.h> 23 #include <deal.II/distributed/tria.h> 25 #include <boost/range/iterator_range.hpp> 30 DEAL_II_NAMESPACE_OPEN
125 template <
int dim,
int spacedim = dim,
typename VectorType = Vector<
double>>
144 static typename VectorType::value_type
147 const VectorType &input_vector)
149 const typename VectorType::value_type value =
150 input_vector[parent->child(0)->active_cell_index()];
152 for (
unsigned int child_index = 1; child_index < parent->n_children();
156 input_vector[parent->child(child_index)->active_cell_index()],
158 "Values on cells that will be coarsened are not equal!"));
167 static typename VectorType::value_type
169 cell_iterator & parent,
170 const VectorType &input_vector)
172 typename VectorType::value_type
sum = 0;
174 for (
unsigned int child_index = 0; child_index < parent->n_children();
177 input_vector[parent->child(child_index)->active_cell_index()];
186 static typename VectorType::value_type
189 const VectorType & input_vector)
191 return sum(parent, input_vector) / parent->n_children();
211 const std::function<
typename VectorType::value_type(
236 const std::vector<const VectorType *> &all_in);
267 unpack(std::vector<VectorType *> &all_out);
299 const std::function<
typename VectorType::value_type(
301 cell_iterator & parent,
302 const VectorType &input_vector)>
333 Triangulation<dim, spacedim>::CellStatus status);
346 const boost::iterator_range<std::vector<char>::const_iterator>
348 std::vector<VectorType *> &all_out);
354 DEAL_II_NAMESPACE_CLOSE
CellDataTransfer(const parallel::distributed::Triangulation< dim, spacedim > &triangulation, const bool transfer_variable_size_data=false, const std::function< typename VectorType::value_type(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)> coarsening_strategy=&CoarseningStrategies::check_equality)
std::vector< const VectorType * > input_vectors
std::vector< char > pack_callback(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &cell, const typename parallel::distributed::Triangulation< dim, spacedim >::CellStatus status)
static VectorType::value_type mean(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)
SmartPointer< const parallel::distributed::Triangulation< dim, spacedim >, CellDataTransfer< dim, spacedim, VectorType > > triangulation
void register_data_attach()
static VectorType::value_type sum(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)
static ::ExceptionBase & ExcMessage(std::string arg1)
static VectorType::value_type check_equality(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)
#define Assert(cond, exc)
const std::function< typename VectorType::value_type(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &parent, const VectorType &input_vector)> coarsening_strategy
void prepare_for_coarsening_and_refinement(const VectorType &in)
void unpack(VectorType &out)
const bool transfer_variable_size_data
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)
void deserialize(VectorType &out)
void prepare_for_serialization(const VectorType &in)
typename ::Triangulation< dim, spacedim >::cell_iterator cell_iterator