15#ifndef dealii_grid_tools_h
16#define dealii_grid_tools_h
48#include <boost/archive/binary_iarchive.hpp>
49#include <boost/archive/binary_oarchive.hpp>
50#include <boost/random/mersenne_twister.hpp>
51#include <boost/serialization/array.hpp>
52#include <boost/serialization/vector.hpp>
54#ifdef DEAL_II_WITH_ZLIB
55# include <boost/iostreams/device/back_inserter.hpp>
56# include <boost/iostreams/filter/gzip.hpp>
57# include <boost/iostreams/filtering_stream.hpp>
58# include <boost/iostreams/stream.hpp>
64#ifdef DEAL_II_HAVE_CXX20
77 template <
int dim,
int spacedim>
86 class MappingCollection;
93 template <
int dim,
int spacedim>
100 template <
int dim,
int spacedim,
typename MeshType>
106 using type =
typename MeshType::active_cell_iterator;
113 template <
int dim,
int spacedim>
219 template <
int dim,
typename Transformation,
int spacedim>
222 std::assignable_from<
234 template <
int dim,
int spacedim>
250 template <
int dim,
int spacedim>
333 const
Function<dim,
double> *coefficient =
nullptr,
334 const
bool solve_for_absolute_positions = false);
343 template <
int dim,
int spacedim>
345 scale(const
double scaling_factor,
377 template <
int dim,
int spacedim>
382 const
bool keep_boundary = true,
383 const
unsigned int seed =
boost::random::mt19937::default_seed);
474 template <
int dim,
int spacedim>
477 const
double limit_angle_fraction = .75);
542 template <
int dim,
int spacedim>
545 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>,
546 std::vector<std::vector<Point<dim>>>,
547 std::vector<std::vector<unsigned int>>>
591 template <
int dim,
int spacedim>
594 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>,
595 std::vector<std::vector<Point<dim>>>,
596 std::vector<std::vector<unsigned int>>,
597 std::vector<unsigned int>>
687 template <
int dim,
int spacedim>
690 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>,
691 std::vector<std::vector<Point<dim>>>,
692 std::vector<std::vector<unsigned int>>,
693 std::vector<std::vector<Point<spacedim>>>,
694 std::vector<std::vector<unsigned int>>>
702 const double tolerance = 1e-10,
703 const std::vector<bool> &marked_vertices = {},
704 const bool enforce_unique_mapping =
true);
722 template <
int dim,
int spacedim>
747 std::vector<std::tuple<std::pair<int, int>,
777 std::vector<std::tuple<unsigned int, unsigned int, unsigned int>>
802 template <
int dim,
int spacedim>
808 const std::vector<bool> &marked_vertices,
809 const double tolerance,
810 const bool perform_handshake,
811 const bool enforce_unique_mapping =
false);
821 template <
int structdim,
int spacedim>
828 std::array<::Point<spacedim>, structdim + 1>;
838 std::vector<std::tuple<std::pair<int, int>,
852 std::vector<std::tuple<unsigned int, unsigned int, IntersectionType>>
884 const unsigned int n_points_1D,
889 const bool consistent_numbering_of_sender_and_receiver =
false)
const;
899 std::map<unsigned int, std::vector<unsigned int>>
901 const std::vector<std::tuple<unsigned int, unsigned int, unsigned int>>
902 &point_recv_components,
913 template <
int structdim,
int dim,
int spacedim>
917 const std::vector<std::vector<
Point<spacedim>>> &intersection_requests,
919 const std::vector<bool> &marked_vertices,
920 const double tolerance);
933 template <
int spacedim>
964 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
968 const MeshType<dim, spacedim> &mesh,
969 const
Point<spacedim> &p,
970 const
std::vector<
bool> &marked_vertices = {});
998 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1002 const
Mapping<dim, spacedim> &mapping,
1003 const MeshType<dim, spacedim> &mesh,
1004 const
Point<spacedim> &p,
1005 const
std::vector<
bool> &marked_vertices = {});
1030 template <
typename MeshType>
1033 std::vector<typename MeshType::active_cell_iterator>
1036 typename ::internal::ActiveCellIterator<MeshType::dimension,
1037 MeshType::space_dimension,
1041 const unsigned int vertex_index);
1108 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1112 std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
Point<dim>>
1114 std::pair<typename ::internal::
1115 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
1119 const MeshType<dim, spacedim> &mesh,
1121 const std::vector<bool> &marked_vertices = {},
1122 const double tolerance = 1.e-10);
1134 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1138 typename MeshType<dim, spacedim>::active_cell_iterator
1140 typename ::internal::
1141 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type
1145 const std::vector<bool> &marked_vertices = {},
1146 const double tolerance = 1.e-10);
1154 template <
int dim,
int spacedim>
1155 std::pair<typename DoFHandler<dim, spacedim>::active_cell_iterator,
1161 const double tolerance = 1.e-10);
1214 template <
int dim,
int spacedim>
1215 std::pair<typename Triangulation<dim, spacedim>::active_cell_iterator,
1218 const Cache<dim, spacedim> &cache,
1222 const std::vector<bool> &marked_vertices = {},
1223 const double tolerance = 1.e-10);
1241 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1245 std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
Point<dim>>
1247 std::pair<typename ::internal::
1248 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
1253 const MeshType<dim, spacedim> &mesh,
1256 std::set<
typename MeshType<dim, spacedim>::active_cell_iterator>>
1259 &vertex_to_cell_centers,
1260 const typename MeshType<dim, spacedim>::active_cell_iterator &cell_hint =
1261 typename MeshType<dim, spacedim>::active_cell_iterator(),
1262 const std::vector<bool> &marked_vertices = {},
1265 const double tolerance = 1.e-10,
1267 std::pair<BoundingBox<spacedim>,
1269 *relevant_cell_bounding_boxes_rtree =
nullptr);
1300 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1304 std::vector<std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
1307 std::vector<std::pair<
1308 typename ::internal::
1309 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
1314 const MeshType<dim, spacedim> &mesh,
1316 const double tolerance,
1317 const std::pair<
typename MeshType<dim, spacedim>::active_cell_iterator,
1320 std::set<
typename MeshType<dim, spacedim>::active_cell_iterator>>
1321 *vertex_to_cells =
nullptr);
1332 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1336 std::vector<std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
1339 std::vector<std::pair<
1340 typename ::internal::
1341 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
1346 const MeshType<dim, spacedim> &mesh,
1348 const double tolerance = 1e-10,
1349 const std::vector<bool> &marked_vertices = {});
1374 template <
typename MeshType>
1377 const typename MeshType::cell_iterator &cell);
1405 template <typename MeshType>
1408 const typename MeshType::active_cell_iterator &cell,
1409 std::vector<typename MeshType::active_cell_iterator> &active_neighbors);
1462 template <typename MeshType>
1466 const MeshType &mesh,
1467 const
std::function<
bool(const typename MeshType::active_cell_iterator &)>
1480 template <typename MeshType>
1484 const MeshType &mesh,
1485 const
std::function<
bool(const typename MeshType::cell_iterator &)>
1487 const
unsigned int level);
1504 template <typename MeshType>
1560 template <typename MeshType>
1564 const MeshType &mesh,
1565 const
std::function<
bool(const typename MeshType::active_cell_iterator &)>
1567 const
double layer_thickness);
1593 template <typename MeshType>
1597 const MeshType &mesh,
1598 const
double layer_thickness);
1672 template <typename MeshType>
1676 const MeshType &mesh,
1677 const
std::function<
bool(const typename MeshType::active_cell_iterator &)>
1679 const
unsigned int refinement_level = 0,
1680 const
bool allow_merge = false,
1681 const
unsigned int max_boxes =
numbers::invalid_unsigned_int);
1710 template <
int spacedim>
1712 std::tuple<std::vector<std::vector<unsigned int>>,
1713 std::map<unsigned int, unsigned int>,
1714 std::map<unsigned int, std::vector<unsigned int>>>
1757 template <
int spacedim>
1759 std::tuple<std::map<unsigned int, std::vector<unsigned int>>,
1760 std::map<unsigned int, unsigned int>,
1761 std::map<unsigned int, std::vector<unsigned int>>>
1781 template <
int dim,
int spacedim>
1782 std::vector<std::vector<Tensor<1, spacedim>>>
1797 template <
int dim,
int spacedim>
1803 (ReferenceCells::get_hypercube<dim>()
1805 .
template get_default_linear_mapping<dim, spacedim>()
1807 .ReferenceCell::get_default_linear_mapping<dim, spacedim>()
1822 template <
int dim,
int spacedim>
1823 std::map<unsigned int, types::global_vertex_index>
1853 template <
int dim,
int spacedim>
1870 template <
int dim,
int spacedim>
1873 const std::vector<unsigned int> &cell_weights,
1923 template <
int dim,
int spacedim>
1941 template <
int dim,
int spacedim>
1944 const std::vector<unsigned int> &cell_weights,
1964 template <
int dim,
int spacedim>
1968 const bool group_siblings =
true);
1981 template <
int dim,
int spacedim>
1992 template <
int dim,
int spacedim>
1993 std::vector<types::subdomain_id>
1995 const std::vector<CellId> &cell_ids);
2007 template <
int dim,
int spacedim>
2010 std::vector<types::subdomain_id> &subdomain);
2026 template <
int dim,
int spacedim>
2061 template <
int dim,
int spacedim>
2091 template <
int dim,
int spacedim>
2149 template <
typename MeshType>
2152 const typename MeshType::active_cell_iterator &cell);
2176 template <
class Container>
2177 std::vector<typename Container::cell_iterator>
2179 const std::vector<typename Container::active_cell_iterator> &patch_cells);
2247 template <
class Container>
2250 const std::vector<typename Container::active_cell_iterator> &patch,
2252 &local_triangulation,
2255 Container::space_dimension>::active_cell_iterator,
2256 typename Container::active_cell_iterator> &patch_to_global_tria_map);
2289 template <
int dim,
int spacedim>
2292 std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
2310 template <
typename CellIterator>
2374 template <
typename FaceIterator>
2375 std::optional<unsigned char>
2377 const FaceIterator &face1,
2378 const FaceIterator &face2,
2379 const unsigned int direction,
2442 template <
typename MeshType>
2445 const MeshType &mesh,
2448 const unsigned int direction,
2480 template <
typename MeshType>
2483 const MeshType &mesh,
2484 const
types::boundary_id b_id,
2485 const
unsigned int direction,
2488 const ::
Tensor<1, MeshType::space_dimension> &offset =
2489 ::
Tensor<1, MeshType::space_dimension>(),
2518 template <
int dim,
int spacedim>
2521 const
bool reset_boundary_ids = false);
2544 template <
int dim,
int spacedim>
2547 const
std::vector<
types::boundary_id> &src_boundary_ids,
2548 const
std::vector<
types::manifold_id> &dst_manifold_ids,
2550 const
std::vector<
types::boundary_id> &reset_boundary_ids = {});
2581 template <
int dim,
int spacedim>
2584 const bool compute_face_ids =
false);
2610 template <
int dim,
int spacedim>
2615 const std::set<types::manifold_id> &)> &disambiguation_function =
2616 [](
const std::set<types::manifold_id> &manifold_ids) {
2617 if (manifold_ids.size() == 1)
2618 return *manifold_ids.begin();
2622 bool overwrite_only_flat_manifold_ids =
true);
2711 template <
typename DataType,
typename MeshType>
2714 const MeshType &mesh,
2715 const
std::function<
std::optional<DataType>(
2716 const typename MeshType::active_cell_iterator &)> &pack,
2717 const
std::function<
void(const typename MeshType::active_cell_iterator &,
2718 const DataType &)> &unpack,
2719 const
std::function<
bool(const typename MeshType::active_cell_iterator &)>
2721 always_return<typename MeshType::active_cell_iterator,
bool>{
true});
2735 template <
typename DataType,
typename MeshType>
2738 const MeshType &mesh,
2739 const
std::function<
std::optional<DataType>(
2740 const typename MeshType::level_cell_iterator &)> &pack,
2741 const
std::function<
void(const typename MeshType::level_cell_iterator &,
2742 const DataType &)> &unpack,
2743 const
std::function<
bool(const typename MeshType::level_cell_iterator &)> &
2744 cell_filter =
always_return<typename MeshType::level_cell_iterator,
bool>{
2758 template <
int spacedim>
2759 std::vector<std::vector<BoundingBox<spacedim>>>
2796 template <
int spacedim>
2819 template <
int dim,
int spacedim>
2823 std::map<
unsigned int, std::vector<unsigned int>> &coinciding_vertex_groups,
2824 std::map<unsigned int, unsigned int> &vertex_to_coinciding_vertex_group);
2845 template <
int dim,
int spacedim>
2846 std::map<unsigned int, std::set<::types::subdomain_id>>
2870 template <
int dim,
typename VectorType>
2899 const VectorType &ls_vector,
2900 const double iso_level,
2910 const VectorType &ls_vector,
2911 const double iso_level,
2925 const VectorType &ls_vector,
2926 const double iso_level,
2936 const VectorType &ls_vector,
2937 const double iso_level,
2954 const double iso_level,
2957 const bool write_back_cell_data =
true)
const;
2965 const std::vector<unsigned int> &,
2982 const std::vector<
Point<2>> &points,
2983 const std::vector<unsigned int> &mask,
2984 const double iso_level,
2987 const bool write_back_cell_data)
const;
2994 const std::vector<
Point<3>> &points,
2995 const std::vector<unsigned int> &mask,
2996 const double iso_level,
2999 const bool write_back_cell_data)
const;
3032 <<
"The number of partitions you gave is " << arg1
3033 <<
", but must be greater than zero.");
3039 <<
"The subdomain id " << arg1
3040 <<
" has no cells associated with it.");
3051 <<
"The scaling factor must be positive, but it is " << arg1
3059 <<
"The given vertex with index " << arg1
3060 <<
" is not used in the given triangulation.");
3099 template <
int dim,
typename Transformation,
int spacedim>
3102 std::assignable_from<
3105 void
transform(const Transformation &transformation,
3108 std::vector<bool> treated_vertices(
triangulation.n_vertices(),
false);
3119 for (; cell != endc; ++cell)
3121 if (treated_vertices[cell->vertex_index(v)] == false)
3124 cell->vertex(v) = transformation(cell->vertex(v));
3126 treated_vertices[cell->vertex_index(v)] =
true;
3136 for (; cell != endc; ++cell)
3137 for (
const unsigned int face : cell->face_indices())
3138 if (cell->face(face)->has_children() &&
3139 !cell->face(face)->at_boundary())
3141 Assert(cell->reference_cell() ==
3142 ReferenceCells::get_hypercube<dim>(),
3146 cell->face(face)->child(0)->vertex(1) =
3147 (cell->face(face)->vertex(0) + cell->face(face)->vertex(1)) /
3156 for (; cell != endc; ++cell)
3157 for (
const unsigned int face : cell->face_indices())
3158 if (cell->face(face)->has_children() &&
3159 !cell->face(face)->at_boundary())
3161 if (
static_cast<uint8_t
>(cell->face(face)->refinement_case()) ==
3164 Assert(cell->reference_cell() ==
3165 ReferenceCells::get_hypercube<dim>(),
3169 cell->face(face)->child(0)->vertex(1) =
3170 (cell->face(face)->vertex(0) +
3171 cell->face(face)->vertex(1)) /
3173 cell->face(face)->child(0)->vertex(2) =
3174 (cell->face(face)->vertex(0) +
3175 cell->face(face)->vertex(2)) /
3177 cell->face(face)->child(1)->vertex(3) =
3178 (cell->face(face)->vertex(1) +
3179 cell->face(face)->vertex(3)) /
3181 cell->face(face)->child(2)->vertex(3) =
3182 (cell->face(face)->vertex(2) +
3183 cell->face(face)->vertex(3)) /
3187 cell->face(face)->child(0)->vertex(3) =
3188 (cell->face(face)->vertex(0) +
3189 cell->face(face)->vertex(1) +
3190 cell->face(face)->vertex(2) +
3191 cell->face(face)->vertex(3)) /
3197 for (
unsigned int line = 0;
3200 if (cell->face(face)->line(line)->has_children())
3201 cell->face(face)->line(line)->child(0)->vertex(1) =
3202 (cell->face(face)->line(line)->vertex(0) +
3203 cell->face(face)->line(line)->vertex(1)) /
3215 template <
typename MeshType>
3218 const typename MeshType::cell_iterator &cell)
3220 std::vector<typename MeshType::active_cell_iterator> child_cells;
3222 if (cell->has_children())
3224 for (
unsigned int child = 0; child < cell->n_children(); ++child)
3225 if (cell->child(child)->has_children())
3227 const std::vector<typename MeshType::active_cell_iterator>
3228 children = get_active_child_cells<MeshType>(cell->child(child));
3229 child_cells.insert(child_cells.end(),
3234 child_cells.push_back(cell->child(child));
3242 template <
typename MeshType>
3245 const typename MeshType::active_cell_iterator &cell,
3246 std::vector<typename MeshType::active_cell_iterator> &active_neighbors)
3248 active_neighbors.clear();
3249 for (
const unsigned int n : cell->face_indices())
3250 if (!cell->at_boundary(n))
3252 if (MeshType::dimension == 1)
3259 typename MeshType::cell_iterator neighbor_child =
3261 if (!neighbor_child->is_active())
3263 while (neighbor_child->has_children())
3264 neighbor_child = neighbor_child->child(n == 0 ? 1 : 0);
3266 Assert(neighbor_child->neighbor(n == 0 ? 1 : 0) == cell,
3269 active_neighbors.push_back(neighbor_child);
3273 if (cell->face(n)->has_children())
3277 for (
unsigned int c = 0;
3278 c < cell->face(n)->n_active_descendants();
3280 active_neighbors.push_back(
3281 cell->neighbor_child_on_subface(n, c));
3287 active_neighbors.push_back(cell->neighbor(n));
3295 template <
typename CellIterator>
3299 return sizeof(*this) +
matrix.memory_consumption();
3306 template <
typename DataType,
3308 typename MeshCellIteratorType>
3310 inline void exchange_cell_data(
3311 const MeshType &mesh,
3312 const std::function<std::optional<DataType>(
const MeshCellIteratorType &)>
3314 const std::function<
void(
const MeshCellIteratorType &,
const DataType &)>
3316 const std::function<
bool(
const MeshCellIteratorType &)> &cell_filter,
3317 const std::function<
void(
3318 const std::function<
void(
const MeshCellIteratorType &,
3320 const std::function<std::set<types::subdomain_id>(
3322 MeshType::space_dimension> &)>
3323 &compute_ghost_owners)
3325# ifndef DEAL_II_WITH_MPI
3330 (void)process_cells;
3331 (void)compute_ghost_owners;
3334 constexpr int dim = MeshType::dimension;
3335 constexpr int spacedim = MeshType::space_dimension;
3338 &mesh.get_triangulation());
3342 "The function exchange_cell_data_to_ghosts() only works with parallel triangulations."));
3344 if (
const auto tria =
dynamic_cast<
3346 &mesh.get_triangulation()))
3349 tria->with_artificial_cells(),
3351 "The functions GridTools::exchange_cell_data_to_ghosts() and "
3352 "GridTools::exchange_cell_data_to_level_ghosts() can only "
3353 "operate on a single layer of ghost cells. However, you have "
3354 "given a Triangulation object of type "
3355 "parallel::shared::Triangulation without artificial cells "
3356 "resulting in an arbitrary number of ghost layers. "
3357 "To use this function for a Triangulation object of type "
3358 "parallel::shared::Triangulation, make sure to create the "
3359 "Triangulation object with allow_artificial_cells set to true. "
3360 "This results in a parallel::shared::Triangulation with only "
3361 "a single layer of ghost cells."));
3365 std::set<::types::subdomain_id> ghost_owners =
3366 compute_ghost_owners(*tria);
3368 std::vector<typename CellId::binary_type>>
3371 for (
const auto ghost_owner : ghost_owners)
3372 neighbor_cell_list[ghost_owner] = {};
3374 process_cells([&](
const auto &cell,
const auto key) ->
void {
3375 if (cell_filter(cell))
3377 constexpr int spacedim = MeshType::space_dimension;
3378 neighbor_cell_list[key].emplace_back(
3379 cell->id().template to_binary<spacedim>());
3383 Assert(ghost_owners.size() == neighbor_cell_list.size(),
3395 const int mpi_tag_reply =
3399 std::vector<MPI_Request> requests(ghost_owners.size());
3401 unsigned int idx = 0;
3402 for (
const auto &it : neighbor_cell_list)
3405 const int ierr = MPI_Isend(it.second.data(),
3406 it.second.size() *
sizeof(it.second[0]),
3418 std::vector<MPI_Request> reply_requests(ghost_owners.size());
3419 std::vector<std::vector<char>> sendbuffers(ghost_owners.size());
3421 for (
unsigned int idx = 0; idx < ghost_owners.size(); ++idx)
3424 int ierr = MPI_Probe(MPI_ANY_SOURCE,
3431 ierr = MPI_Get_count(&status, MPI_BYTE, &len);
3438 std::vector<typename CellId::binary_type> cells_with_requests(
3440 std::vector<DataType> data_to_send;
3441 data_to_send.reserve(n_cells);
3442 std::vector<bool> cell_carries_data(n_cells,
false);
3444 ierr = MPI_Recv(cells_with_requests.data(),
3454 for (
unsigned int c = 0; c < static_cast<unsigned int>(n_cells); ++c)
3459 MeshCellIteratorType mesh_it(tria,
3464 const std::optional<DataType> data =
pack(mesh_it);
3467 data_to_send.emplace_back(*data);
3468 cell_carries_data[c] =
true;
3476 sendbuffers[idx].resize(
sizeof(std::size_t));
3481 std::size_t size_of_send =
3485 std::memcpy(sendbuffers[idx].data(),
3487 sizeof(std::size_t));
3491 if (data_to_send.size() < n_cells)
3497 ierr = MPI_Isend(sendbuffers[idx].data(),
3498 sendbuffers[idx].size(),
3503 &reply_requests[idx]);
3508 std::vector<char> receive;
3509 for (
unsigned int id = 0;
id < neighbor_cell_list.size(); ++id)
3512 int ierr = MPI_Probe(MPI_ANY_SOURCE,
3519 ierr = MPI_Get_count(&status, MPI_BYTE, &len);
3522 receive.resize(len);
3524 ierr = MPI_Recv(receive.data(),
3535 auto data_iterator = receive.begin();
3536 std::size_t size_of_received_data =
3537 Utilities::unpack<std::size_t>(data_iterator,
3538 data_iterator +
sizeof(std::size_t));
3539 data_iterator +=
sizeof(std::size_t);
3542 auto received_data = Utilities::unpack<std::vector<DataType>>(
3544 data_iterator + size_of_received_data,
3546 data_iterator += size_of_received_data;
3551 const std::vector<typename CellId::binary_type> &this_cell_list =
3552 neighbor_cell_list[status.MPI_SOURCE];
3554 std::vector<bool> cells_with_data;
3555 if (received_data.size() < this_cell_list.size())
3557 cells_with_data = Utilities::unpack<std::vector<bool>>(
3558 data_iterator, receive.end(),
false);
3564 auto received_data_iterator = received_data.begin();
3565 for (
unsigned int c = 0; c < this_cell_list.size(); ++c)
3566 if (cells_with_data.empty() || cells_with_data[c])
3571 MeshCellIteratorType cell(tria,
3576 unpack(cell, *received_data_iterator);
3577 ++received_data_iterator;
3583 if (requests.size() > 0)
3586 MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
3589 if (reply_requests.size() > 0)
3591 const int ierr = MPI_Waitall(reply_requests.size(),
3592 reply_requests.data(),
3593 MPI_STATUSES_IGNORE);
3603 template <
typename DataType,
typename MeshType>
3606 const MeshType &mesh,
3607 const std::function<std::optional<DataType>(
3608 const typename MeshType::active_cell_iterator &)> &pack,
3609 const std::function<
void(
const typename MeshType::active_cell_iterator &,
3610 const DataType &)> &unpack,
3611 const std::function<
bool(
const typename MeshType::active_cell_iterator &)>
3614# ifndef DEAL_II_WITH_MPI
3621 internal::exchange_cell_data<DataType,
3623 typename MeshType::active_cell_iterator>(
3628 [&](
const auto &process) {
3629 for (
const auto &cell : mesh.active_cell_iterators())
3630 if (cell->is_ghost())
3633 [](
const auto &tria) {
return tria.ghost_owners(); });
3639 template <
typename DataType,
typename MeshType>
3642 const MeshType &mesh,
3643 const std::function<std::optional<DataType>(
3644 const typename MeshType::level_cell_iterator &)> &pack,
3645 const std::function<
void(
const typename MeshType::level_cell_iterator &,
3646 const DataType &)> &unpack,
3647 const std::function<
bool(
const typename MeshType::level_cell_iterator &)>
3650# ifndef DEAL_II_WITH_MPI
3657 internal::exchange_cell_data<DataType,
3659 typename MeshType::level_cell_iterator>(
3664 [&](
const auto &process) {
3665 for (
const auto &cell : mesh.cell_iterators())
3666 if (cell->is_ghost_on_level())
3667 process(cell, cell->level_subdomain_id());
3669 [](
const auto &tria) {
return tria.level_ghost_owners(); });
std::array< unsigned int, 4 > binary_type
Abstract base class for mapping classes.
cell_iterator create_cell_iterator(const CellId &cell_id) const
virtual MPI_Comm get_mpi_communicator() const
typename MeshType::active_cell_iterator type
#define DEAL_II_DEPRECATED
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_CXX20_REQUIRES(condition)
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcNeedsMPI()
static ::ExceptionBase & ExcNonExistentSubdomain(int arg1)
#define Assert(cond, exc)
static ::ExceptionBase & ExcVertexNotUsed(unsigned int arg1)
#define AssertDimension(dim1, dim2)
#define AssertThrowMPI(error_code)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcTriangulationHasBeenRefined()
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcInvalidNumberOfPartitions(int arg1)
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcScalingFactorNotPositive(double arg1)
#define AssertThrow(cond, exc)
typename ActiveSelector::active_cell_iterator active_cell_iterator
void copy_boundary_to_manifold_id(Triangulation< dim, spacedim > &tria, const bool reset_boundary_ids=false)
void copy_material_to_manifold_id(Triangulation< dim, spacedim > &tria, const bool compute_face_ids=false)
void map_boundary_to_manifold_ids(const std::vector< types::boundary_id > &src_boundary_ids, const std::vector< types::manifold_id > &dst_manifold_ids, Triangulation< dim, spacedim > &tria, const std::vector< types::boundary_id > &reset_boundary_ids={})
void assign_co_dimensional_manifold_indicators(Triangulation< dim, spacedim > &tria, const std::function< types::manifold_id(const std::set< types::manifold_id > &)> &disambiguation_function=[](const std::set< types::manifold_id > &manifold_ids) { if(manifold_ids.size()==1) return *manifold_ids.begin();else return numbers::flat_manifold_id;}, bool overwrite_only_flat_manifold_ids=true)
@ matrix
Contents is actually a matrix.
size_t pack(const T &object, std::vector< char > &dest_buffer, const bool allow_compression=true)
T unpack(const std::vector< char > &buffer, const bool allow_compression=true)
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
const types::manifold_id flat_manifold_id
unsigned int global_dof_index
unsigned int subdomain_id
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
*braid_SplitCommworld & comm
boost::geometry::index::rtree< LeafType, IndexType, IndexableGetter > RTree