Reference documentation for deal.II version GIT relicensing-1312-g94296a292e 2024-07-25 16:30:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
cell_data_transfer.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2019 - 2023 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_distributed_cell_data_transfer_h
16#define dealii_distributed_cell_data_transfer_h
17
18#include <deal.II/base/config.h>
19
21
23
25
26#include <boost/range/iterator_range.hpp>
27
28#include <functional>
29
30
32
33namespace parallel
34{
35 namespace distributed
36 {
125 template <int dim, int spacedim = dim, typename VectorType = Vector<double>>
127 {
128 private:
132 using value_type = typename VectorType::value_type;
133
134 public:
153 const bool transfer_variable_size_data = false,
154 const std::function<std::vector<value_type>(
155 const typename ::Triangulation<dim, spacedim>::cell_iterator
156 &parent,
157 const value_type parent_value)> refinement_strategy =
158 &::AdaptationStrategies::Refinement::
159 preserve<dim, spacedim, value_type>,
160 const std::function<value_type(
161 const typename ::Triangulation<dim, spacedim>::cell_iterator
162 &parent,
163 const std::vector<value_type> &children_values)> coarsening_strategy =
164 &::AdaptationStrategies::Coarsening::
165 check_equality<dim, spacedim, value_type>);
166
179 void
181
185 void
187 const std::vector<const VectorType *> &all_in);
188
199 void
200 prepare_for_serialization(const VectorType &in);
201
205 void
206 prepare_for_serialization(const std::vector<const VectorType *> &all_in);
207
212 void
213 unpack(VectorType &out);
214
218 void
219 unpack(std::vector<VectorType *> &all_out);
220
225 void
226 deserialize(VectorType &out);
227
231 void
232 deserialize(std::vector<VectorType *> &all_out);
233
234 private:
241
246
251 const std::function<std::vector<value_type>(
252 const typename Triangulation<dim, spacedim>::cell_iterator &parent,
253 const value_type parent_value)>
255
260 const std::function<value_type(
261 const typename Triangulation<dim, spacedim>::cell_iterator &parent,
262 const std::vector<value_type> &children_values)>
264
269 std::vector<const VectorType *> input_vectors;
270
275 unsigned int handle;
276
281 void
283
289 std::vector<char>
291 Triangulation<dim, spacedim>::cell_iterator &cell,
292 const CellStatus status);
293
299 void
302 cell_iterator &cell,
303 const CellStatus status,
304 const boost::iterator_range<std::vector<char>::const_iterator>
305 &data_range,
306 std::vector<VectorType *> &all_out);
307 };
308 } // namespace distributed
309} // namespace parallel
310
311
313
314#endif /* dealii_distributed_cell_data_transfer_h */
CellStatus
Definition cell_status.h:31
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
void unpack(std::vector< VectorType * > &all_out)
void prepare_for_coarsening_and_refinement(const VectorType &in)
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 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
void unpack_callback(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &cell, const CellStatus status, const boost::iterator_range< std::vector< char >::const_iterator > &data_range, std::vector< VectorType * > &all_out)
std::vector< char > pack_callback(const typename parallel::distributed::Triangulation< dim, spacedim >::cell_iterator &cell, const CellStatus status)
const std::function< std::vector< value_type >(const typename Triangulation< dim, spacedim >::cell_iterator &parent, const value_type parent_value)> refinement_strategy
std::vector< const VectorType * > input_vectors
typename VectorType::value_type value_type
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
typename ::Triangulation< dim, spacedim >::cell_iterator cell_iterator
Definition tria.h:288
STL namespace.