16 #ifndef dealii_grid_tools_h
17 #define dealii_grid_tools_h
49 #include <boost/archive/binary_iarchive.hpp>
50 #include <boost/archive/binary_oarchive.hpp>
51 #include <boost/random/mersenne_twister.hpp>
52 #include <boost/serialization/array.hpp>
53 #include <boost/serialization/vector.hpp>
55 #ifdef DEAL_II_WITH_ZLIB
56 # include <boost/iostreams/device/back_inserter.hpp>
57 # include <boost/iostreams/filter/gzip.hpp>
58 # include <boost/iostreams/filtering_stream.hpp>
59 # include <boost/iostreams/stream.hpp>
66 #ifdef DEAL_II_HAVE_CXX20
79 template <
int dim,
int spacedim>
88 class MappingCollection;
95 template <
int dim,
int spacedim>
102 template <
int dim,
int spacedim,
typename MeshType>
108 using type =
typename MeshType::active_cell_iterator;
115 template <
int dim,
int spacedim>
221 template <
int dim,
typename Transformation,
int spacedim>
224 std::assignable_from<
236 template <
int dim,
int spacedim>
252 template <
int dim,
int spacedim>
292 const
unsigned int axis,
356 const
Function<dim,
double> *coefficient =
nullptr,
357 const
bool solve_for_absolute_positions = false);
366 template <
int dim,
int spacedim>
368 scale(const
double scaling_factor,
390 template <
int dim,
int spacedim>
395 const
bool keep_boundary = true,
396 const
unsigned int seed =
boost::
random::mt19937::default_seed);
487 template <
int dim,
int spacedim>
490 const
double limit_angle_fraction = .75);
555 template <
int dim,
int spacedim>
558 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>,
559 std::vector<std::vector<Point<dim>>>,
560 std::vector<std::vector<unsigned int>>>
604 template <
int dim,
int spacedim>
607 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>,
608 std::vector<std::vector<Point<dim>>>,
609 std::vector<std::vector<unsigned int>>,
610 std::vector<unsigned int>>
700 template <
int dim,
int spacedim>
703 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>,
704 std::vector<std::vector<Point<dim>>>,
705 std::vector<std::vector<unsigned int>>,
706 std::vector<std::vector<Point<spacedim>>>,
707 std::vector<std::vector<unsigned int>>>
715 const double tolerance = 1
e-10,
716 const std::vector<bool> &marked_vertices = {},
717 const bool enforce_unique_mapping =
true);
735 template <
int dim,
int spacedim>
760 std::vector<std::tuple<std::pair<int, int>,
790 std::vector<std::tuple<unsigned int, unsigned int, unsigned int>>
815 template <
int dim,
int spacedim>
821 const std::vector<bool> &marked_vertices,
822 const double tolerance,
823 const bool perform_handshake,
824 const bool enforce_unique_mapping =
false);
834 template <
int structdim,
int spacedim>
841 std::array<::Point<spacedim>, structdim + 1>;
851 std::vector<std::tuple<std::pair<int, int>,
865 std::vector<std::tuple<unsigned int, unsigned int, IntersectionType>>
892 const unsigned int n_points_1D,
895 const bool consistent_numbering_of_sender_and_receiver =
false)
const;
905 std::map<unsigned int, std::vector<unsigned int>>
907 const std::vector<std::tuple<unsigned int, unsigned int, unsigned int>>
908 &point_recv_components,
909 const MPI_Comm
comm)
const;
919 template <
int structdim,
int dim,
int spacedim>
923 const std::vector<std::vector<
Point<spacedim>>> &intersection_requests,
925 const std::vector<bool> &marked_vertices,
926 const double tolerance);
939 template <
int spacedim>
970 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
974 const MeshType<dim, spacedim> &mesh,
975 const
Point<spacedim> &p,
976 const std::vector<
bool> &marked_vertices = {});
1004 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1008 const
Mapping<dim, spacedim> &mapping,
1009 const MeshType<dim, spacedim> &mesh,
1010 const
Point<spacedim> &p,
1011 const std::vector<
bool> &marked_vertices = {});
1036 template <
typename MeshType>
1039 std::vector<typename MeshType::active_cell_iterator>
1042 typename ::internal::ActiveCellIterator<MeshType::dimension,
1043 MeshType::space_dimension,
1047 const unsigned int vertex_index);
1114 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1118 std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
Point<dim>>
1120 std::pair<typename ::internal::
1121 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
1125 const MeshType<dim, spacedim> &mesh,
1127 const std::vector<bool> &marked_vertices = {},
1128 const double tolerance = 1.e-10);
1140 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1144 typename MeshType<dim, spacedim>::active_cell_iterator
1146 typename ::internal::
1147 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type
1151 const std::vector<bool> &marked_vertices = {},
1152 const double tolerance = 1.e-10);
1160 template <
int dim,
int spacedim>
1161 std::pair<typename DoFHandler<dim, spacedim>::active_cell_iterator,
1167 const double tolerance = 1.e-10);
1220 template <
int dim,
int spacedim>
1221 std::pair<typename Triangulation<dim, spacedim>::active_cell_iterator,
1224 const Cache<dim, spacedim> &cache,
1228 const std::vector<bool> &marked_vertices = {},
1229 const double tolerance = 1.e-10);
1247 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1251 std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
Point<dim>>
1253 std::pair<typename ::internal::
1254 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
1259 const MeshType<dim, spacedim> &mesh,
1262 std::set<
typename MeshType<dim, spacedim>::active_cell_iterator>>
1265 &vertex_to_cell_centers,
1266 const typename MeshType<dim, spacedim>::active_cell_iterator &cell_hint =
1267 typename MeshType<dim, spacedim>::active_cell_iterator(),
1268 const std::vector<bool> &marked_vertices = {},
1271 const double tolerance = 1.e-10,
1273 std::pair<BoundingBox<spacedim>,
1275 *relevant_cell_bounding_boxes_rtree =
nullptr);
1306 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1310 std::vector<std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
1313 std::vector<std::pair<
1314 typename ::internal::
1315 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
1320 const MeshType<dim, spacedim> &mesh,
1322 const double tolerance,
1323 const std::pair<
typename MeshType<dim, spacedim>::active_cell_iterator,
1326 std::set<
typename MeshType<dim, spacedim>::active_cell_iterator>>
1327 *vertex_to_cells =
nullptr);
1338 template <
int dim,
template <
int,
int>
class MeshType,
int spacedim>
1342 std::vector<std::pair<typename MeshType<dim, spacedim>::active_cell_iterator,
1345 std::vector<std::pair<
1346 typename ::internal::
1347 ActiveCellIterator<dim, spacedim, MeshType<dim, spacedim>>::type,
1352 const MeshType<dim, spacedim> &mesh,
1354 const double tolerance = 1
e-10,
1355 const std::vector<bool> &marked_vertices = {});
1380 template <
typename MeshType>
1383 const typename MeshType::cell_iterator &cell);
1411 template <typename MeshType>
1414 const typename MeshType::active_cell_iterator &cell,
1415 std::vector<typename MeshType::active_cell_iterator> &active_neighbors);
1468 template <typename MeshType>
1472 const MeshType &mesh,
1473 const std::function<
bool(const typename MeshType::active_cell_iterator &)>
1486 template <typename MeshType>
1490 const MeshType &mesh,
1491 const std::function<
bool(const typename MeshType::cell_iterator &)>
1493 const
unsigned int level);
1510 template <typename MeshType>
1566 template <typename MeshType>
1570 const MeshType &mesh,
1571 const std::function<
bool(const typename MeshType::active_cell_iterator &)>
1573 const
double layer_thickness);
1599 template <typename MeshType>
1603 const MeshType &mesh,
1604 const
double layer_thickness);
1678 template <typename MeshType>
1682 const MeshType &mesh,
1683 const std::function<
bool(const typename MeshType::active_cell_iterator &)>
1685 const
unsigned int refinement_level = 0,
1686 const
bool allow_merge = false,
1716 template <
int spacedim>
1718 std::tuple<std::vector<std::vector<unsigned int>>,
1719 std::map<unsigned int, unsigned int>,
1720 std::map<unsigned int, std::vector<unsigned int>>>
1763 template <
int spacedim>
1765 std::tuple<std::map<unsigned int, std::vector<unsigned int>>,
1766 std::map<unsigned int, unsigned int>,
1767 std::map<unsigned int, std::vector<unsigned int>>>
1787 template <
int dim,
int spacedim>
1788 std::vector<std::vector<Tensor<1, spacedim>>>
1803 template <
int dim,
int spacedim>
1809 (ReferenceCells::get_hypercube<dim>()
1811 .
template get_default_linear_mapping<dim, spacedim>()
1813 .ReferenceCell::get_default_linear_mapping<dim, spacedim>()
1828 template <
int dim,
int spacedim>
1829 std::map<unsigned int, types::global_vertex_index>
1859 template <
int dim,
int spacedim>
1876 template <
int dim,
int spacedim>
1879 const std::vector<unsigned int> &cell_weights,
1929 template <
int dim,
int spacedim>
1947 template <
int dim,
int spacedim>
1950 const std::vector<unsigned int> &cell_weights,
1970 template <
int dim,
int spacedim>
1974 const bool group_siblings =
true);
1987 template <
int dim,
int spacedim>
1998 template <
int dim,
int spacedim>
1999 std::vector<types::subdomain_id>
2001 const std::vector<CellId> &cell_ids);
2013 template <
int dim,
int spacedim>
2016 std::vector<types::subdomain_id> &subdomain);
2032 template <
int dim,
int spacedim>
2067 template <
int dim,
int spacedim>
2097 template <
int dim,
int spacedim>
2155 template <
typename MeshType>
2158 const typename MeshType::active_cell_iterator &cell);
2182 template <
class Container>
2183 std::vector<typename Container::cell_iterator>
2185 const std::vector<typename Container::active_cell_iterator> &patch_cells);
2253 template <
class Container>
2256 const std::vector<typename Container::active_cell_iterator> &patch,
2258 &local_triangulation,
2261 Container::space_dimension>::active_cell_iterator,
2262 typename Container::active_cell_iterator> &patch_to_global_tria_map);
2295 template <
int dim,
int spacedim>
2298 std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>>
2316 template <
typename CellIterator>
2425 template <
typename FaceIterator>
2426 std::optional<std::bitset<3>>
2428 const FaceIterator &face1,
2429 const FaceIterator &face2,
2430 const unsigned int direction,
2493 template <
typename MeshType>
2496 const MeshType &mesh,
2499 const unsigned int direction,
2531 template <
typename MeshType>
2534 const MeshType &mesh,
2536 const
unsigned int direction,
2539 const ::
Tensor<1, MeshType::space_dimension> &offset =
2540 ::
Tensor<1, MeshType::space_dimension>(),
2569 template <
int dim,
int spacedim>
2572 const
bool reset_boundary_ids = false);
2595 template <
int dim,
int spacedim>
2632 template <
int dim,
int spacedim>
2635 const bool compute_face_ids =
false);
2661 template <
int dim,
int spacedim>
2666 const std::set<types::manifold_id> &)> &disambiguation_function =
2667 [](
const std::set<types::manifold_id> &manifold_ids) {
2668 if (manifold_ids.size() == 1)
2669 return *manifold_ids.
begin();
2673 bool overwrite_only_flat_manifold_ids =
true);
2762 template <
typename DataType,
typename MeshType>
2765 const MeshType &mesh,
2766 const std::function<std::optional<DataType>(
2767 const typename MeshType::active_cell_iterator &)> &
pack,
2768 const std::function<
void(const typename MeshType::active_cell_iterator &,
2769 const DataType &)> &
unpack,
2770 const std::function<
bool(const typename MeshType::active_cell_iterator &)>
2772 always_return<typename MeshType::active_cell_iterator,
bool>{
true});
2786 template <
typename DataType,
typename MeshType>
2789 const MeshType &mesh,
2790 const std::function<std::optional<DataType>(
2791 const typename MeshType::level_cell_iterator &)> &
pack,
2792 const std::function<
void(const typename MeshType::level_cell_iterator &,
2793 const DataType &)> &
unpack,
2794 const std::function<
bool(const typename MeshType::level_cell_iterator &)> &
2795 cell_filter =
always_return<typename MeshType::level_cell_iterator,
bool>{
2809 template <
int spacedim>
2810 std::vector<std::vector<BoundingBox<spacedim>>>
2813 const MPI_Comm mpi_communicator);
2847 template <
int spacedim>
2851 const MPI_Comm mpi_communicator);
2870 template <
int dim,
int spacedim>
2896 template <
int dim,
int spacedim>
2897 std::map<unsigned int, std::set<::types::subdomain_id>>
2921 template <
int dim,
typename VectorType>
2950 const VectorType &ls_vector,
2951 const double iso_level,
2961 const VectorType &ls_vector,
2962 const double iso_level,
2976 const VectorType &ls_vector,
2977 const double iso_level,
2987 const VectorType &ls_vector,
2988 const double iso_level,
3005 const double iso_level,
3008 const bool write_back_cell_data =
true)
const;
3016 const std::vector<unsigned int> &,
3033 const std::vector<
Point<2>> &points,
3034 const std::vector<unsigned int> &mask,
3035 const double iso_level,
3038 const bool write_back_cell_data)
const;
3045 const std::vector<
Point<3>> &points,
3046 const std::vector<unsigned int> &mask,
3047 const double iso_level,
3050 const bool write_back_cell_data)
const;
3083 <<
"The number of partitions you gave is " << arg1
3084 <<
", but must be greater than zero.");
3090 <<
"The subdomain id " << arg1
3091 <<
" has no cells associated with it.");
3102 <<
"The scaling factor must be positive, but it is " << arg1
3110 <<
"The given vertex with index " << arg1
3111 <<
" is not used in the given triangulation.");
3150 template <
int dim,
typename Transformation,
int spacedim>
3153 std::assignable_from<
3156 void
transform(const Transformation &transformation,
3159 std::vector<bool> treated_vertices(
triangulation.n_vertices(),
false);
3170 for (; cell != endc; ++cell)
3171 for (
const unsigned int v : cell->vertex_indices())
3172 if (treated_vertices[cell->vertex_index(v)] ==
false)
3175 cell->vertex(v) = transformation(cell->vertex(v));
3177 treated_vertices[cell->vertex_index(v)] =
true;
3187 for (; cell != endc; ++cell)
3188 for (
const unsigned int face : cell->face_indices())
3189 if (cell->face(face)->has_children() &&
3190 !cell->face(face)->at_boundary())
3192 Assert(cell->reference_cell() ==
3193 ReferenceCells::get_hypercube<dim>(),
3197 cell->face(face)->child(0)->vertex(1) =
3198 (cell->face(face)->vertex(0) + cell->face(face)->vertex(1)) /
3207 for (; cell != endc; ++cell)
3208 for (
const unsigned int face : cell->face_indices())
3209 if (cell->face(face)->has_children() &&
3210 !cell->face(face)->at_boundary())
3212 Assert(cell->reference_cell() ==
3213 ReferenceCells::get_hypercube<dim>(),
3217 cell->face(face)->child(0)->vertex(1) =
3218 (cell->face(face)->vertex(0) + cell->face(face)->vertex(1)) /
3220 cell->face(face)->child(0)->vertex(2) =
3221 (cell->face(face)->vertex(0) + cell->face(face)->vertex(2)) /
3223 cell->face(face)->child(1)->vertex(3) =
3224 (cell->face(face)->vertex(1) + cell->face(face)->vertex(3)) /
3226 cell->face(face)->child(2)->vertex(3) =
3227 (cell->face(face)->vertex(2) + cell->face(face)->vertex(3)) /
3231 cell->face(face)->child(0)->vertex(3) =
3232 (cell->face(face)->vertex(0) + cell->face(face)->vertex(1) +
3233 cell->face(face)->vertex(2) + cell->face(face)->vertex(3)) /
3244 template <
typename MeshType>
3247 const typename MeshType::cell_iterator &cell)
3249 std::vector<typename MeshType::active_cell_iterator> child_cells;
3251 if (cell->has_children())
3253 for (
unsigned int child = 0; child < cell->n_children(); ++child)
3254 if (cell->child(child)->has_children())
3256 const std::vector<typename MeshType::active_cell_iterator>
3257 children = get_active_child_cells<MeshType>(cell->child(child));
3258 child_cells.insert(child_cells.end(),
3263 child_cells.push_back(cell->child(child));
3271 template <
typename MeshType>
3274 const typename MeshType::active_cell_iterator &cell,
3275 std::vector<typename MeshType::active_cell_iterator> &active_neighbors)
3277 active_neighbors.clear();
3278 for (
const unsigned int n : cell->face_indices())
3279 if (!cell->at_boundary(n))
3281 if (MeshType::dimension == 1)
3288 typename MeshType::cell_iterator neighbor_child =
3290 if (!neighbor_child->is_active())
3292 while (neighbor_child->has_children())
3293 neighbor_child = neighbor_child->child(n == 0 ? 1 : 0);
3295 Assert(neighbor_child->neighbor(n == 0 ? 1 : 0) == cell,
3298 active_neighbors.push_back(neighbor_child);
3302 if (cell->face(n)->has_children())
3306 for (
unsigned int c = 0;
3307 c < cell->face(n)->n_active_descendants();
3309 active_neighbors.push_back(
3310 cell->neighbor_child_on_subface(n, c));
3316 active_neighbors.push_back(cell->neighbor(n));
3324 template <
typename CellIterator>
3328 return sizeof(*this) +
matrix.memory_consumption();
3335 template <
typename DataType,
3337 typename MeshCellIteratorType>
3339 inline void exchange_cell_data(
3340 const MeshType &mesh,
3341 const std::function<std::optional<DataType>(
const MeshCellIteratorType &)>
3343 const std::function<
void(
const MeshCellIteratorType &,
const DataType &)>
3345 const std::function<
bool(
const MeshCellIteratorType &)> &cell_filter,
3346 const std::function<
void(
3347 const std::function<
void(
const MeshCellIteratorType &,
3349 const std::function<std::set<types::subdomain_id>(
3351 MeshType::space_dimension> &)>
3352 &compute_ghost_owners)
3354 # ifndef DEAL_II_WITH_MPI
3359 (void)process_cells;
3360 (void)compute_ghost_owners;
3363 constexpr
int dim = MeshType::dimension;
3364 constexpr
int spacedim = MeshType::space_dimension;
3367 &mesh.get_triangulation());
3371 "The function exchange_cell_data_to_ghosts() only works with parallel triangulations."));
3373 if (
const auto tria =
dynamic_cast<
3375 &mesh.get_triangulation()))
3378 tria->with_artificial_cells(),
3380 "The functions GridTools::exchange_cell_data_to_ghosts() and "
3381 "GridTools::exchange_cell_data_to_level_ghosts() can only "
3382 "operate on a single layer of ghost cells. However, you have "
3383 "given a Triangulation object of type "
3384 "parallel::shared::Triangulation without artificial cells "
3385 "resulting in an arbitrary number of ghost layers. "
3386 "To use this function for a Triangulation object of type "
3387 "parallel::shared::Triangulation, make sure to create the "
3388 "Triangulation object with allow_artificial_cells set to true. "
3389 "This results in a parallel::shared::Triangulation with only "
3390 "a single layer of ghost cells."));
3394 std::set<::types::subdomain_id> ghost_owners =
3395 compute_ghost_owners(*
tria);
3397 std::vector<typename CellId::binary_type>>
3400 for (
const auto ghost_owner : ghost_owners)
3401 neighbor_cell_list[ghost_owner] = {};
3403 process_cells([&](
const auto &cell,
const auto key) ->
void {
3404 if (cell_filter(cell))
3406 constexpr
int spacedim = MeshType::space_dimension;
3407 neighbor_cell_list[key].emplace_back(
3408 cell->id().template to_binary<spacedim>());
3412 Assert(ghost_owners.size() == neighbor_cell_list.size(),
3424 const int mpi_tag_reply =
3428 std::vector<MPI_Request> requests(ghost_owners.size());
3430 unsigned int idx = 0;
3431 for (
const auto &it : neighbor_cell_list)
3434 const int ierr = MPI_Isend(it.second.data(),
3435 it.second.size() *
sizeof(it.second[0]),
3447 std::vector<MPI_Request> reply_requests(ghost_owners.size());
3448 std::vector<std::vector<char>> sendbuffers(ghost_owners.size());
3450 for (
unsigned int idx = 0; idx < ghost_owners.size(); ++idx)
3453 int ierr = MPI_Probe(MPI_ANY_SOURCE,
3460 ierr = MPI_Get_count(&status, MPI_BYTE, &len);
3467 std::vector<typename CellId::binary_type> cells_with_requests(
3469 std::vector<DataType> data_to_send;
3470 data_to_send.reserve(
n_cells);
3471 std::vector<bool> cell_carries_data(
n_cells,
false);
3473 ierr = MPI_Recv(cells_with_requests.data(),
3483 for (
unsigned int c = 0; c < static_cast<unsigned int>(
n_cells); ++c)
3488 MeshCellIteratorType mesh_it(
tria,
3493 const std::optional<DataType> data =
pack(mesh_it);
3496 data_to_send.emplace_back(*data);
3497 cell_carries_data[c] =
true;
3505 sendbuffers[idx].resize(
sizeof(std::size_t));
3510 std::size_t size_of_send =
3514 std::memcpy(sendbuffers[idx].data(),
3516 sizeof(std::size_t));
3520 if (data_to_send.size() <
n_cells)
3526 ierr = MPI_Isend(sendbuffers[idx].data(),
3527 sendbuffers[idx].size(),
3532 &reply_requests[idx]);
3537 std::vector<char> receive;
3538 for (
unsigned int id = 0;
id < neighbor_cell_list.size(); ++id)
3541 int ierr = MPI_Probe(MPI_ANY_SOURCE,
3548 ierr = MPI_Get_count(&status, MPI_BYTE, &len);
3551 receive.resize(len);
3553 ierr = MPI_Recv(receive.data(),
3564 auto data_iterator = receive.begin();
3565 std::size_t size_of_received_data =
3566 Utilities::unpack<std::size_t>(data_iterator,
3567 data_iterator +
sizeof(std::size_t));
3568 data_iterator +=
sizeof(std::size_t);
3571 auto received_data = Utilities::unpack<std::vector<DataType>>(
3573 data_iterator + size_of_received_data,
3575 data_iterator += size_of_received_data;
3580 const std::vector<typename CellId::binary_type> &this_cell_list =
3581 neighbor_cell_list[status.MPI_SOURCE];
3583 std::vector<bool> cells_with_data;
3584 if (received_data.size() < this_cell_list.size())
3586 cells_with_data = Utilities::unpack<std::vector<bool>>(
3587 data_iterator, receive.end(),
false);
3593 auto received_data_iterator = received_data.begin();
3594 for (
unsigned int c = 0; c < this_cell_list.size(); ++c)
3595 if (cells_with_data.empty() || cells_with_data[c])
3600 MeshCellIteratorType cell(
tria,
3605 unpack(cell, *received_data_iterator);
3606 ++received_data_iterator;
3612 if (requests.size() > 0)
3615 MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE);
3618 if (reply_requests.size() > 0)
3620 const int ierr = MPI_Waitall(reply_requests.size(),
3621 reply_requests.data(),
3622 MPI_STATUSES_IGNORE);
3632 template <
typename DataType,
typename MeshType>
3635 const MeshType &mesh,
3636 const std::function<std::optional<DataType>(
3637 const typename MeshType::active_cell_iterator &)> &
pack,
3638 const std::function<
void(
const typename MeshType::active_cell_iterator &,
3639 const DataType &)> &
unpack,
3640 const std::function<
bool(
const typename MeshType::active_cell_iterator &)>
3643 # ifndef DEAL_II_WITH_MPI
3650 internal::exchange_cell_data<DataType,
3652 typename MeshType::active_cell_iterator>(
3657 [&](
const auto &process) {
3658 for (
const auto &cell : mesh.active_cell_iterators())
3659 if (cell->is_ghost())
3660 process(cell, cell->subdomain_id());
3662 [](
const auto &
tria) {
return tria.ghost_owners(); });
3668 template <
typename DataType,
typename MeshType>
3671 const MeshType &mesh,
3672 const std::function<std::optional<DataType>(
3673 const typename MeshType::level_cell_iterator &)> &
pack,
3674 const std::function<
void(
const typename MeshType::level_cell_iterator &,
3675 const DataType &)> &
unpack,
3676 const std::function<
bool(
const typename MeshType::level_cell_iterator &)>
3679 # ifndef DEAL_II_WITH_MPI
3686 internal::exchange_cell_data<DataType,
3688 typename MeshType::level_cell_iterator>(
3693 [&](
const auto &process) {
3694 for (
const auto &cell : mesh.cell_iterators())
3695 if (cell->is_ghost_on_level())
3696 process(cell, cell->level_subdomain_id());
3698 [](
const auto &
tria) {
return tria.level_ghost_owners(); });
std::array< unsigned int, 4 > binary_type
virtual MPI_Comm get_communicator() const
cell_iterator create_cell_iterator(const CellId &cell_id) const
cell_iterator begin(const unsigned int level=0) 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
__global__ void set(Number *val, const Number s, const size_type N)
#define DeclException0(Exception0)
static ::ExceptionBase & ExcScalingFactorNotPositive(double arg1)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcNeedsMPI()
static ::ExceptionBase & ExcVertexNotUsed(unsigned int arg1)
static ::ExceptionBase & ExcTriangulationHasBeenRefined()
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotImplemented()
#define AssertDimension(dim1, dim2)
#define AssertThrowMPI(error_code)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInvalidNumberOfPartitions(int arg1)
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcNonExistentSubdomain(int 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)
void random(DoFHandler< dim, spacedim > &dof_handler)
@ matrix
Contents is actually a matrix.
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Number angle(const Tensor< 1, spacedim, Number > &a, const Tensor< 1, spacedim, Number > &b)
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)
constexpr bool is_triangulation_or_dof_handler
concept is_triangulation_or_dof_handler
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
static const unsigned int invalid_unsigned_int
const types::manifold_id flat_manifold_id
unsigned int global_dof_index
unsigned int subdomain_id
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
boost::geometry::index::rtree< LeafType, IndexType, IndexableGetter > RTree
std::map< unsigned int, unsigned int > vertex_to_coinciding_vertex_group
std::map< unsigned int, std::vector< unsigned int > > coinciding_vertex_groups
const ::Triangulation< dim, spacedim > & tria