22template <
int dim,
int spacedim>
25 : cached_tria(
std::make_unique<
GridTools::Cache<dim, spacedim>>(
30 Assert(dim == spacedim, ExcNotImplemented(
"Not available with codim > 0"));
31 Assert(dim == 2 || dim == 3, ExcImpossibleInDim(1));
33 &cached_tria->get_triangulation()) ==
nullptr),
35 Assert(cached_tria->get_triangulation().n_active_cells() > 0,
37 "The triangulation must not be empty upon calling this function."));
46template <
int dim,
int spacedim>
51 Assert(cells.size() > 0, ExcMessage(
"No cells to be agglomerated."));
53 if (cells.size() == 1)
59 cells[0]->global_active_cell_index();
65 cells[0]->as_dof_handler_iterator(
agglo_dh);
69 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>
71 slaves.reserve(cells.size() - 1);
73 for (
auto it = ++cells.begin(); it != cells.end(); ++it)
75 slaves.push_back(*it);
82 (*it)->as_dof_handler_iterator(
agglo_dh);
87 Assert(((*it)->subdomain_id() == tria->locally_owned_subdomain() ||
105 return {cells[0],
this};
108template <
int dim,
int spacedim>
112 const unsigned int fecollection_size)
114 Assert(cells.size() > 0, ExcMessage(
"No cells to be agglomerated."));
116 if (cells.size() == 1)
122 cells[0]->global_active_cell_index();
128 cells[0]->as_dof_handler_iterator(
agglo_dh);
132 std::vector<typename Triangulation<dim, spacedim>::active_cell_iterator>
134 slaves.reserve(cells.size() - 1);
136 for (
auto it = ++cells.begin(); it != cells.end(); ++it)
138 slaves.push_back(*it);
145 (*it)->as_dof_handler_iterator(
agglo_dh);
146 cell->set_active_fe_index(
151 Assert(((*it)->subdomain_id() == tria->locally_owned_subdomain() ||
169 return {cells[0],
this};
174template <
int dim,
int spacedim>
179 Assert(cells.size() > 0, ExcMessage(
"No cells to be agglomerated."));
186 std::vector<std::vector<types::global_cell_index>> connected_components;
191 if (connected_components.size() > 1)
192 std::cout <<
"Disconnected elements. Connected components will be "
193 "computed and agglomerated together."
198 std::vector<typename Triangulation<dim>::active_cell_iterator> agglomerate;
199 for (
const auto &comp : connected_components)
201 agglomerate.reserve(comp.size());
203 agglomerate.push_back(cells[local_idx]);
212template <
int dim,
int spacedim>
227 std::make_unique<FEValues<dim>>(*mapping,
240template <
int dim,
int spacedim>
271template <
int dim,
int spacedim>
276 unsigned int n_neighbors = 0;
277 for (
const auto &f : cell->face_indices())
279 const auto &neighboring_cell = cell->neighbor(f);
280 if ((cell->face(f)->at_boundary()) ||
281 (neighboring_cell->is_active() &&
292template <
int dim,
int spacedim>
297 tria = &cache_tria->get_triangulation();
298 mapping = &cache_tria->get_mapping();
302 if (
const auto parallel_tria =
dynamic_cast<
303 const dealii::parallel::TriangulationBase<dim, spacedim> *
>(&*tria))
305 const std::weak_ptr<const Utilities::MPI::Partitioner> cells_partitioner =
306 parallel_tria->global_active_cell_index_partitioner();
308 cells_partitioner.lock()->locally_owned_range(), communicator);
312 master_slave_relationships.reinit(tria->n_active_cells(), MPI_COMM_SELF);
315 polytope_cache.clear();
319 cached_tria = std::make_unique<GridTools::Cache<dim, spacedim>>(
320 cache_tria->get_triangulation(), cache_tria->get_mapping());
322 connect_to_tria_signals();
323 n_agglomerations = 0;
328template <
int dim,
int spacedim>
334 fe = std::make_unique<FE_DGQ<dim>>(fe_space.
degree);
336 fe = std::make_unique<FE_AggloDGP<dim>>(fe_space.
degree);
338 fe = std::make_unique<FE_SimplexDGP<dim>>(fe_space.
degree);
343 "Currently, this interface supports only DGQ and DGP bases."));
356 std::make_unique<ScratchData>(*mapping,
363 fe_collection.push_back(*fe);
364 fe_collection.push_back(
371 const bool needs_ghost_info =
374 if (needs_ghost_info)
379 if (needs_ghost_info)
383template <
int dim,
int spacedim>
402 "Hybrid mesh is not implemented for hp::FECollection."));
405 for (
unsigned int i = 0; i < fe_collection_in.
size(); ++i)
407 if (
dynamic_cast<const FESystem<dim> *
>(&fe_collection_in[i]))
410 for (
unsigned int b = 0;
b < fe_collection_in[i].n_base_elements();
414 &fe_collection_in[i].base_element(
b)) ||
416 &fe_collection_in[i].base_element(
b)) ||
418 &fe_collection_in[i].base_element(
b)) ||
420 &fe_collection_in[i].base_element(
b))))
424 "Currently, this interface supports only DGQ and DGP bases."));
430 if (!(
dynamic_cast<const FE_DGQ<dim> *
>(&fe_collection_in[i]) ||
436 "Currently, this interface supports only DGQ and DGP bases."));
438 fe_collection.push_back(fe_collection_in[i]);
441 Assert(fe_collection[0].n_components() >= 1,
442 ExcMessage(
"Invalid FE: must have at least one component."));
443 if (fe_collection[0].n_components() == 1)
447 else if (fe_collection[0].n_components() > 1)
449 std::vector<const FiniteElement<dim, spacedim> *> base_elements;
450 std::vector<unsigned int> multiplicities;
451 for (
unsigned int b = 0;
b < fe_collection[0].n_base_elements(); ++
b)
454 multiplicities.push_back(fe_collection[0].element_multiplicity(
b));
457 for (
const auto *ptr : base_elements)
459 fe_collection.push_back(fe_system_nothing);
466 const bool needs_ghost_info =
469 if (needs_ghost_info)
474 if (needs_ghost_info)
478template <
int dim,
int spacedim>
484 ExcMessage(
"No agglomeration has been performed."));
485 Assert(dim > 1, ExcNotImplemented());
487 std::vector<Point<spacedim>> pts;
488 for (
const auto &cell : polytope)
489 for (
const auto i : cell->vertex_indices())
490 pts.push_back(cell->vertex(i));
492 bboxes.emplace_back(pts);
497template <
int dim,
int spacedim>
502 ExcMessage(
"No agglomeration has been performed."));
506 "The DoFHandler associated to the agglomeration has not been initialized."
507 "It's likely that you forgot to distribute the DoFs. You may want"
508 "to check if a call to `initialize_hp_structure()` has been done."));
526 recv_ghosted_master_id =
533template <
int dim,
int spacedim>
537 const unsigned int dofs_per_cell = fe->dofs_per_cell;
540 if (polytope->is_locally_owned())
542 const unsigned int n_faces = polytope->n_faces();
543 for (
unsigned int f = 0; f < n_faces; ++f)
545 if (!polytope->at_boundary(f))
547 const auto &neigh_polytope = polytope->neighbor(f);
548 if (!neigh_polytope->is_locally_owned())
553 const auto ¤t_fe =
reinit(polytope, f);
555 std::vector<Point<spacedim>> qpoints_to_send =
556 current_fe.get_quadrature_points();
558 const std::vector<double> &jxws_to_send =
559 current_fe.get_JxW_values();
561 const std::vector<Tensor<1, spacedim>> &normals_to_send =
562 current_fe.get_normal_vectors();
566 neigh_polytope->subdomain_id();
568 std::pair<CellId, unsigned int> cell_and_face{
571 local_qpoints[neigh_rank].emplace(cell_and_face,
574 local_jxws[neigh_rank].emplace(cell_and_face,
577 local_normals[neigh_rank].emplace(cell_and_face,
581 const unsigned int n_qpoints = qpoints_to_send.size();
585 std::vector<std::vector<double>> values_per_qpoints(
588 std::vector<std::vector<Tensor<1, spacedim>>>
589 gradients_per_qpoints(dofs_per_cell);
591 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
593 values_per_qpoints[i].resize(n_qpoints);
594 gradients_per_qpoints[i].resize(n_qpoints);
595 for (
unsigned int q = 0; q < n_qpoints; ++q)
597 values_per_qpoints[i][q] =
598 current_fe.shape_value(i, q);
599 gradients_per_qpoints[i][q] =
600 current_fe.shape_grad(i, q);
604 local_values[neigh_rank].emplace(cell_and_face,
606 local_gradients[neigh_rank].emplace(
607 cell_and_face, gradients_per_qpoints);
624template <
int dim,
int spacedim>
633 ExcMessage(
"This must be a master cell."));
635 std::vector<Point<dim>> vec_pts;
636 std::vector<double> vec_JxWs;
641 for (
const auto &dummy_cell : cells)
644 auto q_points =
no_values->get_quadrature_points();
647 std::transform(q_points.begin(),
649 std::back_inserter(vec_pts),
651 std::transform(JxWs.begin(),
653 std::back_inserter(vec_JxWs),
654 [&](
const double w) { return w; });
660 const auto &master_cell_as_dh_iterator =
661 master_cell->as_dof_handler_iterator(agglo_dh);
662 for (
const auto &dummy_cell : cells)
679 master_cell_as_dh_iterator->active_fe_index(),
683 .get_quadrature_points();
687 std::transform(q_points.begin(),
689 std::back_inserter(vec_pts),
691 std::transform(JxWs.begin(),
693 std::back_inserter(vec_JxWs),
694 [&](
const double w) { return w; });
700 std::vector<Point<dim>> unit_points(vec_pts.size());
702 bboxes[master2polygon.at(master_cell->active_cell_index())];
703 unit_points.reserve(vec_pts.size());
705 for (
unsigned int i = 0; i < vec_pts.size(); i++)
706 unit_points[i] = bbox.real_to_unit(vec_pts[i]);
713template <
int dim,
int spacedim>
719 "Triangulation must not be empty upon calling this function."));
721 ExcMessage(
"No agglomeration has been performed."));
723 agglo_dh.distribute_dofs(fe_collection);
731template <
int dim,
int spacedim>
773template <
int dim,
int spacedim>
777 const unsigned int face_index,
779 &agglo_isv_ptr)
const
787template <
int dim,
int spacedim>
791 const unsigned int face_index)
const
807template <
int dim,
int spacedim>
808std::pair<const FEValuesBase<dim, spacedim> &,
813 const unsigned int local_in,
814 const unsigned int local_neigh)
const
822 const auto &neigh_cell =
831 std::pair<const FEValuesBase<dim, spacedim> &,
844 const auto &bbox = bboxes[
master2polygon.at(cell->active_cell_index())];
847 const unsigned int neigh_rank = neigh_polytope->
subdomain_id();
848 const CellId &neigh_id = neigh_polytope->
id();
852 std::vector<Point<spacedim>> &real_qpoints =
853 recv_qpoints.at(neigh_rank).at({neigh_id, local_neigh});
855 const auto &JxWs =
recv_jxws.at(neigh_rank).at({neigh_id, local_neigh});
857 std::vector<Tensor<1, spacedim>> &normals =
858 recv_normals.at(neigh_rank).at({neigh_id, local_neigh});
861 std::vector<Point<spacedim>> final_unit_q_points;
862 std::transform(real_qpoints.begin(),
864 std::back_inserter(final_unit_q_points),
866 return bbox.real_to_unit(p);
888 for (
unsigned int q = 0; q < final_unit_q_points.size(); ++q)
893 final_unit_q_points, JxWs, normals);
896 std::make_unique<NonMatching::FEImmersedSurfaceValues<spacedim>>(
902 std::pair<const FEValuesBase<dim, spacedim> &,
912template <
int dim,
int spacedim>
913template <
typename SparsityPatternType,
typename Number>
916 SparsityPatternType &dsp,
918 const bool keep_constrained_dofs,
922 ExcMessage(
"The agglomeration has not been set up correctly."));
925 "The Sparsity pattern must be empty upon calling this function."));
928 const IndexSet locally_relevant_dofs =
931 if constexpr (std::is_same_v<SparsityPatternType, DynamicSparsityPattern>)
932 dsp.reinit(locally_owned_dofs.
size(),
933 locally_owned_dofs.
size(),
934 locally_relevant_dofs);
935 else if constexpr (std::is_same_v<SparsityPatternType,
937 dsp.reinit(locally_owned_dofs, communicator);
944 agglo_dh, dsp, constraints, keep_constrained_dofs, subdomain_id);
950 const unsigned int dofs_per_cell =
agglo_dh.get_fe(0).n_dofs_per_cell();
951 std::vector<types::global_dof_index> current_dof_indices(dofs_per_cell);
952 std::vector<types::global_dof_index> neighbor_dof_indices(dofs_per_cell);
958 if (polytope->is_locally_owned())
960 const unsigned int n_current_faces = polytope->n_faces();
961 polytope->get_dof_indices(current_dof_indices);
962 for (
unsigned int f = 0; f < n_current_faces; ++f)
964 const auto &neigh_polytope = polytope->neighbor(f);
967 neigh_polytope->get_dof_indices(neighbor_dof_indices);
970 neighbor_dof_indices,
972 keep_constrained_dofs,
987 if (polytope->is_locally_owned())
989 const unsigned int current_dofs_per_cell =
990 polytope->get_fe().dofs_per_cell;
991 std::vector<types::global_dof_index> current_dof_indices(
992 current_dofs_per_cell);
994 const unsigned int n_current_faces = polytope->n_faces();
995 polytope->get_dof_indices(current_dof_indices);
996 for (
unsigned int f = 0; f < n_current_faces; ++f)
998 const auto &neigh_polytope = polytope->neighbor(f);
1001 const unsigned int neighbor_dofs_per_cell =
1002 neigh_polytope->get_fe().dofs_per_cell;
1003 std::vector<types::global_dof_index> neighbor_dof_indices(
1004 neighbor_dofs_per_cell);
1006 neigh_polytope->get_dof_indices(neighbor_dof_indices);
1008 current_dof_indices,
1009 neighbor_dof_indices,
1011 keep_constrained_dofs,
1021 if constexpr (std::is_same_v<SparsityPatternType,
1028template <
int dim,
int spacedim>
1032 [[maybe_unused]]
const auto parallel_triangulation =
1034 Assert(parallel_triangulation !=
nullptr, ExcInternalError());
1037 std::vector<types::global_dof_index> global_dof_indices(
n_dofs_per_cell);
1039 if (polytope->is_locally_owned())
1041 const CellId &master_cell_id = polytope->id();
1043 const auto polytope_dh = polytope->as_dof_handler_iterator(
agglo_dh);
1044 polytope_dh->get_dof_indices(global_dof_indices);
1047 const auto &agglomerate = polytope->get_agglomerate();
1049 for (
const auto &cell : agglomerate)
1052 for (
const auto &f : cell->face_indices())
1054 if (!cell->at_boundary(f))
1056 const auto &neighbor = cell->neighbor(f);
1057 if (neighbor->is_ghost())
1061 neighbor->subdomain_id();
1065 local_cell_ids_neigh_cell[neigh_rank].emplace(
1066 cell->id(), master_cell_id);
1070 local_ghost_dofs[neigh_rank].emplace(
1071 master_cell_id, global_dof_indices);
1074 const auto &bbox = bboxes[polytope->index()];
1075 local_ghosted_bbox[neigh_rank].emplace(master_cell_id,
1083 recv_cell_ids_neigh_cell =
1101 template <
int dim,
int spacedim>
1108 const unsigned int face_index,
1114 ExcMessage(
"This cell must be a master one."));
1117 const auto &neigh_polytope = it->
neighbor(face_index);
1119 const CellId polytope_in_id = cell->id();
1123 handler.bboxes[handler.
master2polygon.at(cell->active_cell_index())];
1127 polytope_out_id = neigh_polytope->id();
1129 polytope_out_id = polytope_in_id;
1132 {polytope_in_id, polytope_out_id});
1134 std::vector<Point<spacedim>> final_unit_q_points;
1135 std::vector<double> final_weights;
1136 std::vector<Tensor<1, dim>> final_normals;
1141 const unsigned int expected_qpoints =
1143 final_unit_q_points.reserve(expected_qpoints);
1144 final_weights.reserve(expected_qpoints);
1145 final_normals.reserve(expected_qpoints);
1148 for (
const auto &[deal_cell, local_face_idx] : common_face)
1152 const auto &q_points =
1155 const auto &normals =
1158 const unsigned int n_qpoints_agglo = q_points.size();
1160 for (
unsigned int q = 0; q < n_qpoints_agglo; ++q)
1162 final_unit_q_points.push_back(
1163 bbox.real_to_unit(q_points[q]));
1164 final_weights.push_back(JxWs[q]);
1165 final_normals.push_back(normals[q]);
1172 unsigned int higher_order_quad_index = cell->active_fe_index();
1175 .agglomeration_face_quad_collection[cell->active_fe_index()]
1179 ->active_fe_index()]
1181 higher_order_quad_index = neigh_polytope->active_fe_index();
1183 const unsigned int expected_qpoints =
1184 common_face.size() *
1188 final_unit_q_points.reserve(expected_qpoints);
1189 final_weights.reserve(expected_qpoints);
1190 final_normals.reserve(expected_qpoints);
1192 for (
const auto &[deal_cell, local_face_idx] : common_face)
1195 deal_cell, local_face_idx, higher_order_quad_index, 0, 0);
1197 const auto &q_points =
1199 .get_quadrature_points();
1203 const auto &normals =
1205 .get_normal_vectors();
1207 const unsigned int n_qpoints_agglo = q_points.size();
1209 for (
unsigned int q = 0; q < n_qpoints_agglo; ++q)
1211 final_unit_q_points.push_back(
1212 bbox.real_to_unit(q_points[q]));
1213 final_weights.push_back(JxWs[q]);
1214 final_normals.push_back(normals[q]);
1221 final_unit_q_points, final_weights, final_normals);
1226 std::make_unique<NonMatching::FEImmersedSurfaceValues<spacedim>>(
1235 std::make_unique<NonMatching::FEImmersedSurfaceValues<spacedim>>(
1242 agglo_isv_ptr->reinit(cell);
1244 return *agglo_isv_ptr;
1263 ->global_active_cell_index()] ==
1265 ExcMessage(
"The present cell with index " +
1266 std::to_string(master_cell->global_active_cell_index()) +
1267 "is not a master one."));
1273 CellId current_polytope_id = master_cell->id();
1276 std::set<types::global_cell_index> visited_polygonal_neighbors;
1278 std::map<unsigned int, CellId> face_to_neigh_id;
1280 std::map<unsigned int, bool> is_face_at_boundary;
1283 std::set<CellId> visited_polygonal_neighbors_id;
1284 unsigned int ghost_counter = 0;
1286 for (
const auto &cell : agglomeration)
1289 cell->active_cell_index();
1291 const CellId cell_id = cell->id();
1293 for (
const auto f : cell->face_indices())
1295 const auto &neighboring_cell = cell->neighbor(f);
1297 const bool valid_neighbor =
1302 if (neighboring_cell->is_locally_owned() &&
1328 neighboring_cell->active_cell_index();
1331 const auto &master_of_neighbor =
1333 neighboring_cell_index);
1335 const auto nof = cell->neighbor_of_neighbor(f);
1341 neighbor_polytope_index =
1343 master_of_neighbor->active_cell_index());
1345 CellId neighbor_polytope_id =
1346 master_of_neighbor->id();
1348 if (visited_polygonal_neighbors.find(
1349 neighbor_polytope_index) ==
1350 std::end(visited_polygonal_neighbors))
1354 const unsigned int n_face =
1356 [current_polytope_index];
1359 current_polytope_index, n_face}] = {
1360 false, master_of_neighbor};
1362 is_face_at_boundary[n_face] =
true;
1365 [current_polytope_index];
1367 visited_polygonal_neighbors.insert(
1368 neighbor_polytope_index);
1373 .find({cell_index, f}) ==
1375 .visited_cell_and_faces))
1379 current_polytope_id, neighbor_polytope_id}]
1380 .emplace_back(cell, f);
1388 .find({neighboring_cell_index, nof}) ==
1390 .visited_cell_and_faces))
1394 neighbor_polytope_id, current_polytope_id}]
1395 .emplace_back(neighboring_cell, nof);
1398 .insert({neighboring_cell_index, nof});
1407 neighbor_polytope_index =
1409 neighboring_cell_index);
1411 CellId neighbor_polytope_id =
1412 neighboring_cell->id();
1414 if (visited_polygonal_neighbors.find(
1415 neighbor_polytope_index) ==
1416 std::end(visited_polygonal_neighbors))
1419 const unsigned int n_face =
1421 [current_polytope_index];
1425 current_polytope_index, n_face}] = {
1426 false, neighboring_cell};
1428 is_face_at_boundary[n_face] =
true;
1431 [current_polytope_index];
1433 visited_polygonal_neighbors.insert(
1434 neighbor_polytope_index);
1440 .find({cell_index, f}) ==
1442 .visited_cell_and_faces))
1446 current_polytope_id, neighbor_polytope_id}]
1447 .emplace_back(cell, f);
1454 .find({neighboring_cell_index, nof}) ==
1456 .visited_cell_and_faces))
1460 neighbor_polytope_id, current_polytope_id}]
1461 .emplace_back(neighboring_cell, nof);
1464 .insert({neighboring_cell_index, nof});
1468 else if (neighboring_cell->is_ghost())
1470 const auto nof = cell->neighbor_of_neighbor(f);
1477 const auto &check_neigh_poly_ids =
1478 handler.recv_cell_ids_neigh_cell.at(
1479 neighboring_cell->subdomain_id());
1481 const CellId neighboring_cell_id =
1482 neighboring_cell->id();
1484 const CellId &check_neigh_polytope_id =
1485 check_neigh_poly_ids.at(neighboring_cell_id);
1490 if (visited_polygonal_neighbors_id.find(
1491 check_neigh_polytope_id) ==
1492 std::end(visited_polygonal_neighbors_id))
1495 current_polytope_index,
1497 [current_polytope_index]}] = {
false,
1503 current_polytope_id,
1505 [current_polytope_index]}] =
1506 check_neigh_polytope_id;
1509 const unsigned int n_face =
1511 [current_polytope_index];
1513 face_to_neigh_id[n_face] = check_neigh_polytope_id;
1515 is_face_at_boundary[n_face] =
false;
1520 [current_polytope_index];
1522 visited_polygonal_neighbors_id.insert(
1523 check_neigh_polytope_id);
1533 .find({cell_id, f}) ==
1539 current_polytope_id, check_neigh_polytope_id}]
1540 .emplace_back(cell, f);
1550 .insert({cell_id, f});
1555 .find({neighboring_cell_id, nof}) ==
1561 check_neigh_polytope_id, current_polytope_id}]
1562 .emplace_back(neighboring_cell, nof);
1565 .insert({neighboring_cell_id, nof});
1569 else if (cell->face(f)->at_boundary())
1577 if (visited_polygonal_neighbors.find(
1578 std::numeric_limits<unsigned int>::max()) ==
1579 std::end(visited_polygonal_neighbors))
1584 current_polytope_index,
1586 [current_polytope_index]}] = {
true,
1589 const unsigned int n_face =
1591 [current_polytope_index];
1593 is_face_at_boundary[n_face] =
true;
1596 [current_polytope_index];
1598 visited_polygonal_neighbors.insert(
1599 std::numeric_limits<unsigned int>::max());
1610 current_polytope_id, current_polytope_id}]
1611 .emplace_back(cell, f);
1622 if (ghost_counter > 0)
1624 const auto parallel_triangulation =
dynamic_cast<
1625 const dealii::parallel::TriangulationBase<dim, spacedim> *
>(
1628 const unsigned int n_faces_current_poly =
1634 for (
const unsigned int neigh_rank :
1635 parallel_triangulation->ghost_owners())
1637 handler.local_n_faces[neigh_rank].emplace(current_polytope_id,
1638 n_faces_current_poly);
1640 handler.local_bdary_info[neigh_rank].emplace(
1641 current_polytope_id, is_face_at_boundary);
1643 handler.local_ghosted_master_id[neigh_rank].emplace(
1644 current_polytope_id, face_to_neigh_id);
1662 const bool keep_constrained_dofs,
1669 const bool keep_constrained_dofs,
1677 const bool keep_constrained_dofs,
1684 const bool keep_constrained_dofs,
1692 const bool keep_constrained_dofs,
1699 const bool keep_constrained_dofs,
void add_entries_local_to_global(const std::vector< size_type > &local_dof_indices, SparsityPatternBase &sparsity_pattern, const bool keep_constrained_entries=true, const Table< 2, bool > &dof_mask=Table< 2, bool >()) const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
const unsigned int degree
unsigned int size() const
AgglomerationContainer get_agglomerate() const
bool is_locally_owned() const
const AgglomerationIterator< dim, spacedim > neighbor(const unsigned int f) const
const FiniteElement< dim, spacedim > & get_fe() const
DoFHandler< dim, spacedim >::active_cell_iterator as_dof_handler_iterator(const DoFHandler< dim, spacedim > &dof_handler) const
types::subdomain_id subdomain_id() const
unsigned int n_dofs_per_cell() const noexcept
AgglomerationHandler()=default
LinearAlgebra::distributed::Vector< float > master_slave_relationships
const FEValues< dim, spacedim > & reinit(const AgglomerationIterator< dim, spacedim > &polytope) const
FE_Nothing< dim, spacedim > dummy_fe
std::unique_ptr< NonMatching::FEImmersedSurfaceValues< spacedim > > agglomerated_isv_bdary
std::unique_ptr< hp::FEValues< dim, spacedim > > hp_no_values
bool is_slave_cell(const CellIterator &cell) const
std::unique_ptr< NonMatching::FEImmersedSurfaceValues< spacedim > > agglomerated_isv
std::unique_ptr< ScratchData > standard_scratch
Quadrature< dim > agglomeration_quad
typename AgglomerationIterator< dim, spacedim >::AgglomerationContainer AgglomerationContainer
std::map< types::subdomain_id, std::map< std::pair< CellId, unsigned int >, std::vector< double > > > recv_jxws
std::map< types::subdomain_id, std::map< std::pair< CellId, unsigned int >, std::vector< Tensor< 1, spacedim > > > > recv_normals
Quadrature< dim - 1 > agglomeration_face_quad
std::unique_ptr< FEValues< dim, spacedim > > no_values
void exchange_interface_values()
std::unique_ptr< hp::FEFaceValues< dim, spacedim > > hp_no_face_values
bool are_cells_agglomerated(const typename Triangulation< dim, spacedim >::active_cell_iterator &cell, const typename Triangulation< dim, spacedim >::active_cell_iterator &other_cell) const
unsigned int n_agglomerations
Quadrature< dim > agglomerated_quadrature(const AgglomerationContainer &cells, const typename Triangulation< dim, spacedim >::active_cell_iterator &master_cell) const
AgglomerationIterator< dim, spacedim > agglomeration_iterator
hp::QCollection< dim - 1 > agglomeration_face_quad_collection
std::map< const typename Triangulation< dim, spacedim >::active_cell_iterator, std::vector< typename Triangulation< dim >::active_face_iterator > > polygon_boundary
std::unordered_map< types::global_cell_index, std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator > > master2slaves
void create_bounding_box(const AgglomerationContainer &polytope)
std::map< types::global_cell_index, types::global_cell_index > master2polygon
std::map< types::subdomain_id, std::map< std::pair< CellId, unsigned int >, std::vector< Point< spacedim > > > > recv_qpoints
std::pair< const FEValuesBase< dim, spacedim > &, const FEValuesBase< dim, spacedim > & > reinit_interface(const AgglomerationIterator< dim, spacedim > &polytope_in, const AgglomerationIterator< dim, spacedim > &neigh_polytope, const unsigned int local_in, const unsigned int local_outside) const
void setup_connectivity_of_agglomeration()
std::map< types::subdomain_id, std::map< std::pair< CellId, unsigned int >, std::vector< std::vector< Tensor< 1, spacedim > > > > > recv_gradients
const Triangulation< dim, spacedim > & get_triangulation() const
void create_agglomeration_sparsity_pattern(SparsityPatternType &sparsity_pattern, const AffineConstraints< Number > &constraints=AffineConstraints< Number >(), const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
const Mapping< dim > & get_mapping() const
void setup_ghost_polytopes()
std::map< types::global_cell_index, typename Triangulation< dim, spacedim >::active_cell_iterator > master_slave_relationships_iterators
std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator > get_agglomerate(const typename Triangulation< dim, spacedim >::active_cell_iterator &master_cell) const
unsigned int n_agglomerated_faces_per_cell(const typename Triangulation< dim, spacedim >::active_cell_iterator &cell) const
const UpdateFlags internal_agglomeration_face_flags
void distribute_agglomerated_dofs(const FiniteElement< dim > &fe_space)
hp::FECollection< dim, spacedim > dummy_fe_collection
std::vector< types::global_cell_index > number_of_agglomerated_faces
const UpdateFlags internal_agglomeration_flags
std::unique_ptr< FEFaceValues< dim, spacedim > > no_face_values
const FEValuesBase< dim, spacedim > & reinit_master(const typename DoFHandler< dim, spacedim >::active_cell_iterator &cell, const unsigned int face_number, std::unique_ptr< NonMatching::FEImmersedSurfaceValues< spacedim > > &agglo_isv_ptr) const
std::vector< typename Triangulation< dim, spacedim >::active_cell_iterator > master_cells_container
friend class AgglomerationIterator
std::unique_ptr< hp::FECollection< dim, spacedim > > hp_fe_collection
hp::QCollection< dim > agglomeration_quad_collection
bool is_master_cell(const CellIterator &cell) const
IteratorRange< agglomeration_iterator > polytope_iterators() const
void initialize_agglomeration_data(const std::unique_ptr< GridTools::Cache< dim, spacedim > > &cache_tria)
agglomeration_iterator define_agglomerate(const AgglomerationContainer &cells)
void initialize_fe_values(const Quadrature< dim > &cell_quadrature=QGauss< dim >(1), const UpdateFlags &flags=UpdateFlags::update_default, const Quadrature< dim - 1 > &face_quadrature=QGauss< dim - 1 >(1), const UpdateFlags &face_flags=UpdateFlags::update_default)
std::unique_ptr< NonMatching::FEImmersedSurfaceValues< spacedim > > agglomerated_isv_neigh
void define_agglomerate_with_check(const AgglomerationContainer &cells)
std::unique_ptr< ScratchData > agglomerated_scratch
UpdateFlags agglomeration_face_flags
DoFHandler< dim, spacedim > agglo_dh
void initialize_hp_structure()
std::unique_ptr< MappingBox< dim > > box_mapping
UpdateFlags agglomeration_flags
internal::PolytopeCache< dim, spacedim > polytope_cache
hp::MappingCollection< dim > mapping_collection
static void setup_master_neighbor_connectivity(const typename Triangulation< dim, spacedim >::active_cell_iterator &master_cell, const AgglomerationHandler< dim, spacedim > &handler)
static const FEValuesBase< dim, spacedim > & reinit_master(const typename DoFHandler< dim, spacedim >::active_cell_iterator &cell, const unsigned int face_index, std::unique_ptr< NonMatching::FEImmersedSurfaceValues< spacedim > > &agglo_isv_ptr, const AgglomerationHandler< dim, spacedim > &handler)
unsigned int size() const
#define Assert(cond, exc)
#define AssertThrow(cond, exc)
TriaActiveIterator< CellAccessor< dim, spacedim > > active_cell_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints={}, const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
Tensor< 2, dim, Number > w(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
std::map< unsigned int, T > some_to_some(const MPI_Comm comm, const std::map< unsigned int, T > &objects_to_send)
void create_graph_from_agglomerate(const std::vector< typename Triangulation< dim >::active_cell_iterator > &cells, Graph &g)
void compute_connected_components(Graph &g, std::vector< std::vector< types::global_cell_index > > &connected_components)
constexpr types::subdomain_id invalid_subdomain_id
unsigned int subdomain_id
unsigned int global_cell_index