76 template <
int dim,
typename Number =
double>
88 double downstream_size = 0;
90 for (
unsigned int d = 0; d < dim; ++d)
92 downstream_size += (rhs[d] - lhs[d]) * weight;
95 if (downstream_size < 0)
97 else if (downstream_size > 0)
101 for (
unsigned int d = 0; d < dim; ++d)
103 if (lhs[d] == rhs[d])
105 return lhs[d] < rhs[d];
125 template <
int dim,
int spacedim>
126 std::vector<unsigned char>
130 std::vector<unsigned char> local_component_association(
139 local_component_association[i] =
150 const unsigned int first_comp =
155 local_component_association[i] = first_comp;
162 for (
unsigned int c = first_comp; c < fe.
n_components(); ++c)
163 if (component_mask[c] ==
true)
165 local_component_association[i] = c;
170 Assert(std::find(local_component_association.begin(),
171 local_component_association.end(),
172 static_cast<unsigned char>(-1)) ==
173 local_component_association.end(),
176 return local_component_association;
196 template <
int dim,
int spacedim>
201 std::vector<unsigned char> &dofs_by_component,
204 const ::hp::FECollection<dim, spacedim> &fe_collection =
208 const auto &locally_owned_dofs =
214 locally_owned_dofs.n_elements());
223 std::vector<std::vector<unsigned char>> local_component_association(
224 fe_collection.size());
225 for (
unsigned int f = 0; f < fe_collection.size(); ++f)
228 local_component_association[f] =
233 std::vector<types::global_dof_index> indices;
235 const auto runner = [&](
const auto &task) {
241 indices.resize(cell->get_fe().n_dofs_per_cell());
242 cell->get_dof_indices(indices);
249 for (
const auto &cell :
251 if (cell->is_locally_owned_on_level())
253 indices.resize(cell->get_fe().n_dofs_per_cell());
254 cell->get_mg_dof_indices(indices);
261 runner([&](
const auto &cell) {
263 for (
unsigned int i = 0; i < cell->get_fe().n_dofs_per_cell(); ++i)
264 if (locally_owned_dofs.is_element(indices[i]))
265 dofs_by_component[locally_owned_dofs.index_within_set(indices[i])] =
266 local_component_association[fe_index][i];
278 template <
int dim,
int spacedim>
281 std::vector<unsigned char> &dofs_by_block)
283 const ::hp::FECollection<dim, spacedim> &fe_collection =
297 std::vector<std::vector<unsigned char>> local_block_association(
298 fe_collection.size());
299 for (
unsigned int f = 0; f < fe_collection.size(); ++f)
303 static_cast<unsigned char>(-1));
307 Assert(std::find(local_block_association[f].
begin(),
308 local_block_association[f].
end(),
309 static_cast<unsigned char>(-1)) ==
310 local_block_association[f].
end(),
315 std::vector<types::global_dof_index> indices;
317 if (cell->is_locally_owned())
320 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
321 indices.resize(dofs_per_cell);
322 cell->get_dof_indices(indices);
323 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
326 indices[i])] = local_block_association[fe_index][i];
333 template <
int dim,
int spacedim,
typename Number>
338 const unsigned int component)
347 for (
unsigned int i = 0; i < fe_collection.size(); ++i)
349 Assert(fe_collection[i].is_primitive() ==
true,
356 const bool consider_components =
360 if (consider_components ==
false)
364 std::vector<unsigned char> component_dofs(
371 for (
unsigned int i = 0; i < dof_data.
size(); ++i)
372 if (component_dofs[i] ==
static_cast<unsigned char>(component))
377 std::vector<unsigned char> touch_count(dof_handler.
n_dofs(), 0);
379 std::vector<types::global_dof_index> dof_indices;
380 dof_indices.reserve(fe_collection.max_dofs_per_cell());
384 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
385 dof_indices.resize(dofs_per_cell);
386 cell->get_dof_indices(dof_indices);
388 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
391 if (!consider_components ||
392 (cell->get_fe().system_to_component_index(i).first == component))
395 dof_data(dof_indices[i]) += cell_data(cell->active_cell_index());
398 ++touch_count[dof_indices[i]];
408 Assert(consider_components || (touch_count[i] != 0),
410 if (touch_count[i] != 0)
411 dof_data(i) /= touch_count[i];
417 template <
int dim,
int spacedim>
425 "The given component mask is not sized correctly to represent the "
426 "components of the given finite element."));
444 std::vector<types::global_dof_index> selected_dofs;
447 if (component_mask[dofs_by_component[i]] ==
true)
452 result.
add_indices(selected_dofs.begin(), selected_dofs.end());
458 template <
int dim,
int spacedim>
464 return extract_dofs<dim, spacedim>(
470 template <
int dim,
int spacedim>
471 std::vector<IndexSet>
478 "The given component mask is not sized correctly to represent the "
479 "components of the given finite element."));
488 std::vector<IndexSet> index_per_comp(n_comps,
IndexSet(dof.
n_dofs()));
492 const auto &comp_i = dofs_by_component[i];
493 if (component_mask[comp_i])
494 index_per_comp[comp_i].add_index(
495 locally_owned_dofs.nth_index_in_set(i));
497 for (
const auto &c : index_per_comp)
499 return index_per_comp;
504 template <
int dim,
int spacedim>
509 std::vector<bool> &selected_dofs)
516 "The given component mask is not sized correctly to represent the "
517 "components of the given finite element."));
526 std::fill_n(selected_dofs.begin(), dof.
n_dofs(
level),
false);
533 std::fill_n(selected_dofs.begin(), dof.
n_dofs(
level),
true);
538 std::fill_n(selected_dofs.begin(), dof.
n_dofs(
level),
false);
542 std::vector<unsigned char> local_component_association =
546 local_selected_dofs[i] = component_mask[local_component_association[i]];
552 cell->get_mg_dof_indices(indices);
554 selected_dofs[indices[i]] = local_selected_dofs[i];
560 template <
int dim,
int spacedim>
565 std::vector<bool> &selected_dofs)
576 template <
int dim,
int spacedim>
580 std::vector<bool> &selected_dofs,
581 const std::set<types::boundary_id> &boundary_ids)
587 "This function can not be used with distributed triangulations. "
588 "See the documentation for more information."));
594 selected_dofs.clear();
595 selected_dofs.resize(dof_handler.
n_dofs(),
false);
603 template <
int dim,
int spacedim>
608 const std::set<types::boundary_id> &boundary_ids)
617 template <
int dim,
int spacedim>
621 const std::set<types::boundary_id> &boundary_ids)
625 ExcMessage(
"Component mask has invalid size."));
634 const bool check_boundary_id = (boundary_ids.size() != 0);
638 const bool check_vector_component =
644 std::vector<types::global_dof_index> face_dof_indices;
645 face_dof_indices.reserve(
657 if (cell->is_artificial() ==
false)
658 for (
const unsigned int face : cell->face_indices())
659 if (cell->at_boundary(face))
660 if (!check_boundary_id ||
661 (boundary_ids.find(cell->face(face)->boundary_id()) !=
666 const auto reference_cell = cell->reference_cell();
668 const unsigned int n_vertices_per_cell =
669 reference_cell.n_vertices();
670 const unsigned int n_lines_per_cell = reference_cell.n_lines();
671 const unsigned int n_vertices_per_face =
672 reference_cell.face_reference_cell(face).n_vertices();
673 const unsigned int n_lines_per_face =
674 reference_cell.face_reference_cell(face).n_lines();
677 face_dof_indices.resize(dofs_per_face);
678 cell->face(face)->get_dof_indices(face_dof_indices,
679 cell->active_fe_index());
682 if (!check_vector_component)
683 selected_dofs.
add_index(face_dof_indices[i]);
698 (dim == 3 ? (i < n_vertices_per_face *
701 (i < n_vertices_per_face *
705 (i - n_vertices_per_face *
707 n_vertices_per_cell *
710 n_vertices_per_face *
714 n_vertices_per_cell *
724 selected_dofs.
add_index(face_dof_indices[i]);
728 const unsigned int first_nonzero_comp =
734 if (component_mask[first_nonzero_comp] ==
true)
735 selected_dofs.
add_index(face_dof_indices[i]);
740 return selected_dofs;
745 template <
int dim,
int spacedim>
750 std::vector<bool> &selected_dofs,
751 const std::set<types::boundary_id> &boundary_ids)
755 ExcMessage(
"This component mask has the wrong size."));
762 const bool check_boundary_id = (boundary_ids.size() != 0);
766 const bool check_vector_component =
770 selected_dofs.clear();
771 selected_dofs.resize(dof_handler.
n_dofs(),
false);
772 std::vector<types::global_dof_index> cell_dof_indices;
773 cell_dof_indices.reserve(
783 for (
const unsigned int face : cell->face_indices())
784 if (cell->at_boundary(face))
785 if (!check_boundary_id ||
786 (boundary_ids.find(cell->face(face)->boundary_id()) !=
792 cell_dof_indices.resize(dofs_per_cell);
793 cell->get_dof_indices(cell_dof_indices);
798 if (!check_vector_component)
799 selected_dofs[cell_dof_indices[i]] =
true;
806 selected_dofs[cell_dof_indices[i]] =
811 const unsigned int first_nonzero_comp =
817 selected_dofs[cell_dof_indices[i]] =
818 (component_mask[first_nonzero_comp] ==
true);
827 template <
int dim,
int spacedim,
typename number>
836 const std::function<
bool(
841 ->
bool {
return cell->is_locally_owned() && predicate(cell); };
843 std::vector<types::global_dof_index> local_dof_indices;
844 local_dof_indices.reserve(
848 std::set<types::global_dof_index> predicate_dofs_owned_cells;
850 for (
const auto &cell :
853 local_dof_indices.resize(cell->get_fe().n_dofs_per_cell());
854 cell->get_dof_indices(local_dof_indices);
855 predicate_dofs_owned_cells.insert(local_dof_indices.begin(),
856 local_dof_indices.end());
860 predicate_owned_set.
add_indices(predicate_dofs_owned_cells.begin(),
861 predicate_dofs_owned_cells.end());
877 std::set<types::global_dof_index> non_predicate_dofs_halo_cells;
878 std::set<types::global_dof_index> predicate_dofs_ghosts;
880 for (
const auto &cell :
884 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
885 local_dof_indices.resize(dofs_per_cell);
886 cell->get_dof_indices(local_dof_indices);
890 predicate_dofs_ghosts.insert(local_dof_indices.begin(),
891 local_dof_indices.end());
894 non_predicate_dofs_halo_cells.insert(local_dof_indices.begin(),
895 local_dof_indices.end());
925 if (
const auto parallel_triangulation =
926 dynamic_cast<const ::parallel::TriangulationBase<dim> *
>(
930 const std::set<::types::subdomain_id> ghost_owners =
931 parallel_triangulation->ghost_owners();
933 std::map<unsigned, std::set<::types::global_dof_index>>
935 for (
const auto rank : ghost_owners)
937 data_to_send[rank] = non_predicate_dofs_halo_cells;
940 const auto additional_non_predicate_halo_dofs =
947 for (
const auto &[rank, indices] : additional_non_predicate_halo_dofs)
949 for (
const auto index : indices)
951 if (locally_stored_constraints.
is_element(index))
953 non_predicate_dofs_halo_cells.insert(index);
960 non_predicate_halo_set.
add_indices(non_predicate_dofs_halo_cells.begin(),
961 non_predicate_dofs_halo_cells.end());
965 predicate_ghost_set.
add_indices(predicate_dofs_ghosts.begin(),
966 predicate_dofs_ghosts.end());
976 std::set<types::global_dof_index> constraining_ghost_dofs;
977 for (
const auto dof : predicate_owned_set)
981 const unsigned int line_size = line_ptr->size();
982 for (
unsigned int j = 0; j < line_size; ++j)
984 constraining_ghost_dofs.insert((*line_ptr)[j].first);
989 constraining_ghost_dofs.begin(), constraining_ghost_dofs.end());
995 support_set.
add_indices(constraining_predicate_ghost_set);
1008 std::set<types::global_dof_index> dofs_constraining_halo;
1009 for (
const auto dof : non_predicate_halo_set)
1013 const unsigned int line_size = line_ptr->size();
1014 for (
unsigned int j = 0; j < line_size; ++j)
1015 dofs_constraining_halo.insert((*line_ptr)[j].first);
1020 dofs_constraining_halo_set.
add_indices(dofs_constraining_halo.begin(),
1021 dofs_constraining_halo.end());
1037 template <
int spacedim>
1046 template <
int spacedim>
1050 const unsigned int dim = 2;
1058 for (
const auto &cell : dof_handler.active_cell_iterators())
1059 if (!cell->is_artificial())
1061 for (
const unsigned int face : cell->face_indices())
1062 if (cell->face(face)->has_children())
1065 line = cell->face(face);
1069 selected_dofs.add_index(
1070 line->child(0)->vertex_dof_index(1, dof));
1072 for (
unsigned int child = 0; child < 2; ++child)
1074 if (cell->neighbor_child_on_subface(face, child)
1079 selected_dofs.add_index(
1080 line->child(child)->dof_index(dof));
1085 selected_dofs.compress();
1086 return selected_dofs;
1090 template <
int spacedim>
1094 const unsigned int dim = 3;
1101 for (
const auto &cell : dof_handler.active_cell_iterators())
1102 if (!cell->is_artificial())
1103 for (auto f : cell->face_indices())
1107 if (cell->face(f)->has_children())
1109 for (
unsigned int child = 0; child < 4; ++child)
1110 if (!cell->neighbor_child_on_subface(f, child)
1114 std::vector<types::global_dof_index> ldi(
1116 face->child(child)->get_dof_indices(ldi);
1117 selected_dofs.add_indices(ldi.begin(), ldi.end());
1122 for (
unsigned int vertex = 0; vertex < 4; ++vertex)
1125 unconstrained_dofs.add_index(
1126 face->vertex_dof_index(vertex, dof));
1129 selected_dofs.subtract_set(unconstrained_dofs);
1130 return selected_dofs;
1137 template <
int dim,
int spacedim>
1141 return internal::extract_hanging_node_dofs(dof_handler);
1146 template <
int dim,
int spacedim>
1150 std::vector<bool> &selected_dofs)
1156 std::fill_n(selected_dofs.begin(), dof_handler.
n_dofs(),
false);
1158 std::vector<types::global_dof_index> local_dof_indices;
1159 local_dof_indices.reserve(
1165 if (cell->subdomain_id() == subdomain_id)
1167 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
1168 local_dof_indices.resize(dofs_per_cell);
1169 cell->get_dof_indices(local_dof_indices);
1170 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1171 selected_dofs[local_dof_indices[i]] =
true;
1177 template <
int dim,
int spacedim>
1187 std::vector<types::global_dof_index> dof_indices;
1188 std::set<types::global_dof_index> global_dof_indices;
1193 dof_indices.resize(cell->get_fe().n_dofs_per_cell());
1194 cell->get_dof_indices(dof_indices);
1198 global_dof_indices.insert(dof_index);
1201 dof_set.
add_indices(global_dof_indices.begin(), global_dof_indices.end());
1210 template <
int dim,
int spacedim>
1220 template <
int dim,
int spacedim>
1224 const unsigned int level)
1232 std::vector<types::global_dof_index> dof_indices;
1233 std::set<types::global_dof_index> global_dof_indices;
1235 const auto filtered_iterators_range =
1238 for (
const auto &cell : filtered_iterators_range)
1240 dof_indices.resize(cell->get_fe().n_dofs_per_cell());
1241 cell->get_mg_dof_indices(dof_indices);
1245 global_dof_indices.insert(dof_index);
1248 dof_set.
add_indices(global_dof_indices.begin(), global_dof_indices.end());
1257 template <
int dim,
int spacedim>
1262 const unsigned int level)
1269 template <
int dim,
int spacedim>
1284 std::vector<types::global_dof_index> dof_indices;
1285 std::vector<types::global_dof_index> dofs_on_ghosts;
1288 if (cell->is_ghost())
1290 dof_indices.resize(cell->get_fe().n_dofs_per_cell());
1291 cell->get_dof_indices(dof_indices);
1292 for (
const auto dof_index : dof_indices)
1294 dofs_on_ghosts.push_back(dof_index);
1298 std::sort(dofs_on_ghosts.begin(), dofs_on_ghosts.end());
1299 dof_set.
add_indices(dofs_on_ghosts.begin(), dofs_on_ghosts.end());
1307 template <
int dim,
int spacedim>
1317 template <
int dim,
int spacedim>
1321 const unsigned int level)
1334 std::vector<types::global_dof_index> dof_indices;
1335 std::vector<types::global_dof_index> dofs_on_ghosts;
1346 dof_indices.resize(cell->get_fe().n_dofs_per_cell());
1347 cell->get_mg_dof_indices(dof_indices);
1348 for (
const auto dof_index : dof_indices)
1350 dofs_on_ghosts.push_back(dof_index);
1354 std::sort(dofs_on_ghosts.begin(), dofs_on_ghosts.end());
1355 dof_set.
add_indices(dofs_on_ghosts.begin(), dofs_on_ghosts.end());
1363 template <
int dim,
int spacedim>
1367 const unsigned int level,
1376 template <
int dim,
int spacedim>
1377 std::vector<std::vector<bool>>
1380 const unsigned int mg_level)
1382 std::vector<std::vector<bool>> constant_modes;
1384 const auto &locally_owned_dofs =
1391 if (locally_owned_dofs.n_elements() == 0)
1393 return std::vector<std::vector<bool>>(0);
1400 std::vector<unsigned char> dofs_by_component(
1401 locally_owned_dofs.n_elements());
1406 unsigned int n_selected_dofs = 0;
1407 for (
unsigned int i = 0; i < n_components; ++i)
1408 if (component_mask[i] ==
true)
1410 std::count(dofs_by_component.begin(), dofs_by_component.end(), i);
1413 std::vector<unsigned int> component_numbering(
1415 for (
unsigned int i = 0, count = 0; i < locally_owned_dofs.n_elements();
1417 if (component_mask[dofs_by_component[i]])
1418 component_numbering[i] = count++;
1425 const ::hp::FECollection<dim, spacedim> &fe_collection =
1427 std::vector<Table<2, bool>> element_constant_modes;
1428 std::vector<std::vector<std::pair<unsigned int, unsigned int>>>
1429 constant_mode_to_component_translation(n_components);
1431 unsigned int n_constant_modes = 0;
1432 int first_non_empty_constant_mode = -1;
1433 for (
unsigned int f = 0; f < fe_collection.size(); ++f)
1435 std::pair<Table<2, bool>, std::vector<unsigned int>>
data =
1436 fe_collection[f].get_constant_modes();
1440 if (first_non_empty_constant_mode < 0 &&
data.first.n_rows() > 0)
1442 first_non_empty_constant_mode = f;
1446 for (
unsigned int i = 0; i <
data.second.size(); ++i)
1447 if (component_mask[
data.second[i]])
1448 constant_mode_to_component_translation[
data.second[i]]
1449 .emplace_back(n_constant_modes++, i);
1455 element_constant_modes.push_back(
data.first);
1456 Assert(element_constant_modes.back().n_rows() == 0 ||
1457 element_constant_modes.back().n_rows() ==
1458 element_constant_modes[first_non_empty_constant_mode]
1466 constant_modes.clear();
1467 constant_modes.resize(n_constant_modes,
1468 std::vector<bool>(n_selected_dofs,
false));
1472 std::vector<types::global_dof_index> dof_indices;
1474 const auto runner = [&](
const auto &task) {
1480 dof_indices.resize(cell->get_fe().n_dofs_per_cell());
1481 cell->get_dof_indices(dof_indices);
1488 for (
const auto &cell :
1490 if (cell->is_locally_owned_on_level())
1492 dof_indices.resize(cell->get_fe().n_dofs_per_cell());
1493 cell->get_mg_dof_indices(dof_indices);
1500 runner([&](
const auto &cell) {
1501 for (
unsigned int i = 0; i < dof_indices.size(); ++i)
1502 if (locally_owned_dofs.is_element(dof_indices[i]))
1504 const unsigned int loc_index =
1505 locally_owned_dofs.index_within_set(dof_indices[i]);
1506 const unsigned int comp = dofs_by_component[loc_index];
1507 if (component_mask[comp])
1508 for (auto &indices :
1509 constant_mode_to_component_translation[comp])
1510 constant_modes[indices
1511 .first][component_numbering[loc_index]] =
1512 element_constant_modes[cell->active_fe_index()](
1517 return constant_modes;
1529 static constexpr unsigned int n_modes = dim * (dim + 1) / 2;
1534 value(
const Point<dim> &p,
const unsigned int component)
const override;
1560 cproduct[0] = +tensor1[1] * tensor2[0];
1561 cproduct[1] = -tensor1[0] * tensor2[0];
1571 cproduct[0] = +tensor1[1] * tensor2[2] - tensor1[2] * tensor2[1];
1572 cproduct[1] = +tensor1[2] * tensor2[0] - tensor1[0] * tensor2[2];
1573 cproduct[2] = +tensor1[0] * tensor2[1] - tensor1[1] * tensor2[0];
1582 const unsigned int component)
const
1585 return static_cast<double>(component == type);
1587 if constexpr (dim >= 2)
1589 Tensor<1, n_modes - dim> dir;
1590 dir[type - dim] = 1.0;
1604 template <
int dim,
int spacedim>
1605 std::vector<std::vector<double>>
1609 const unsigned int mg_level)
1615 std::vector<std::vector<double>> rigid_body_modes(n_modes);
1626 for (
unsigned int i = 0; i < n_modes; ++i)
1631 rigid_body_modes_dealii,
1636 rigid_body_modes[i].assign(rigid_body_modes_dealii.begin(),
1637 rigid_body_modes_dealii.end());
1640 return rigid_body_modes;
1647 template <
int dim,
int spacedim>
1648 std::vector<std::vector<bool>>
1659 template <
int dim,
int spacedim>
1663 std::vector<std::vector<bool>> &constant_modes)
1669 constant_modes = temp;
1674 template <
int dim,
int spacedim>
1675 std::vector<std::vector<bool>>
1685 template <
int dim,
int spacedim>
1690 std::vector<std::vector<bool>> &constant_modes)
1694 constant_modes = temp;
1699 template <
int dim,
int spacedim>
1700 std::vector<std::vector<double>>
1713 template <
int dim,
int spacedim>
1714 std::vector<std::vector<double>>
1728 template <
int dim,
int spacedim>
1729 std::map<
typename DoFHandler<dim - 1, spacedim>::active_cell_iterator,
1730 std::pair<typename DoFHandler<dim, spacedim>::active_cell_iterator,
1741 std::map<
typename DoFHandler<dim - 1, spacedim>::active_cell_iterator,
1742 std::pair<typename DoFHandler<dim, spacedim>::active_cell_iterator,
1744 c1_to_c0_cell_and_face;
1747 if (c1_to_c0_face.empty())
1748 return c1_to_c0_cell_and_face;
1751 std::map<typename Triangulation<dim, spacedim>::face_iterator,
1752 typename DoFHandler<dim - 1, spacedim>::active_cell_iterator>
1756 for (
const auto &[c1_cell, c0_cell] : c1_to_c0_face)
1757 if (!c1_cell->has_children())
1758 c0_to_c1[c0_cell] = c1_cell->as_dof_handler_iterator(c1_dh);
1762 for (
const auto &cell :
1764 for (
const auto f : cell->face_indices())
1765 if (cell->face(f)->at_boundary())
1767 const auto &it = c0_to_c1.find(cell->face(f));
1768 if (it != c0_to_c1.end())
1770 const auto &c1_cell = it->second;
1771 c1_to_c0_cell_and_face[c1_cell] = {cell, f};
1777 return c1_to_c0_cell_and_face;
1782 template <
int dim,
int spacedim>
1783 std::vector<IndexSet>
1787 ExcMessage(
"The given DoFHandler has no DoFs."));
1795 "For parallel::distributed::Triangulation objects and "
1796 "associated DoF handler objects, asking for any information "
1797 "related to a subdomain other than the locally owned one does "
1798 "not make sense."));
1802 std::vector<::types::subdomain_id> subdomain_association(
1805 subdomain_association);
1819 const unsigned int n_subdomains =
1823 unsigned int max_subdomain_id = 0;
1826 std::max(max_subdomain_id, cell->subdomain_id());
1827 return max_subdomain_id + 1;
1833 Assert(n_subdomains > *std::max_element(subdomain_association.begin(),
1834 subdomain_association.end()),
1837 std::vector<::IndexSet> index_sets(
1846 index < subdomain_association.size();
1850 if (subdomain_association[index] != this_subdomain)
1852 index_sets[this_subdomain].add_range(i_min, index);
1854 this_subdomain = subdomain_association[index];
1859 if (i_min == subdomain_association.size() - 1)
1861 index_sets[this_subdomain].add_index(i_min);
1867 index_sets[this_subdomain].add_range(i_min,
1868 subdomain_association.size());
1871 for (
unsigned int i = 0; i < n_subdomains; ++i)
1872 index_sets[i].compress();
1877 template <
int dim,
int spacedim>
1878 std::vector<IndexSet>
1888 "For parallel::distributed::Triangulation objects and "
1889 "associated DoF handler objects, asking for any information "
1890 "related to a subdomain other than the locally owned one does "
1891 "not make sense."));
1899 std::vector<IndexSet> dof_set =
1901 const ::types::subdomain_id n_subdomains = dof_set.size();
1907 subdomain_id < n_subdomains;
1920 std::vector<types::global_dof_index> local_dof_indices;
1921 std::set<types::global_dof_index> subdomain_halo_global_dof_indices;
1922 for (
typename std::vector<
1925 it_cell != active_halo_layer.end();
1931 cell->subdomain_id() != subdomain_id,
1933 "The subdomain ID of the halo cell should not match that of the vector entry."));
1936 cell->get_dof_indices(local_dof_indices);
1940 subdomain_halo_global_dof_indices.insert(local_dof_index);
1943 dof_set[subdomain_id].add_indices(
1944 subdomain_halo_global_dof_indices.begin(),
1945 subdomain_halo_global_dof_indices.end());
1947 dof_set[subdomain_id].compress();
1953 template <
int dim,
int spacedim>
1957 std::vector<types::subdomain_id> &subdomain_association)
1965 "For parallel::distributed::Triangulation objects and "
1966 "associated DoF handler objects, asking for any subdomain other "
1967 "than the locally owned one does not make sense."));
1969 Assert(subdomain_association.size() == dof_handler.
n_dofs(),
1983 std::vector<types::subdomain_id> cell_owners(
1989 cell_owners = tr->get_true_subdomain_ids_of_cells();
1990 Assert(tr->get_true_subdomain_ids_of_cells().size() ==
1991 tr->n_active_cells(),
1998 cell_owners[cell->active_cell_index()] = cell->subdomain_id();
2002 std::fill_n(subdomain_association.begin(),
2006 std::vector<types::global_dof_index> local_dof_indices;
2007 local_dof_indices.reserve(
2015 cell_owners[cell->active_cell_index()];
2016 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
2017 local_dof_indices.resize(dofs_per_cell);
2018 cell->get_dof_indices(local_dof_indices);
2024 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
2025 if (subdomain_association[local_dof_indices[i]] ==
2027 subdomain_association[local_dof_indices[i]] = subdomain_id;
2028 else if (subdomain_association[local_dof_indices[i]] > subdomain_id)
2030 subdomain_association[local_dof_indices[i]] = subdomain_id;
2034 Assert(std::find(subdomain_association.begin(),
2035 subdomain_association.end(),
2037 subdomain_association.end(),
2043 template <
int dim,
int spacedim>
2049 std::vector<types::subdomain_id> subdomain_association(
2053 return std::count(subdomain_association.begin(),
2054 subdomain_association.end(),
2060 template <
int dim,
int spacedim>
2073 "For parallel::distributed::Triangulation objects and "
2074 "associated DoF handler objects, asking for any subdomain other "
2075 "than the locally owned one does not make sense."));
2079 std::vector<types::global_dof_index> local_dof_indices;
2080 local_dof_indices.reserve(
2088 std::vector<types::global_dof_index> subdomain_indices;
2091 if ((cell->is_artificial() ==
false) &&
2092 (cell->subdomain_id() == subdomain))
2094 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
2095 local_dof_indices.resize(dofs_per_cell);
2096 cell->get_dof_indices(local_dof_indices);
2097 subdomain_indices.insert(subdomain_indices.end(),
2098 local_dof_indices.begin(),
2099 local_dof_indices.end());
2102 std::sort(subdomain_indices.begin(), subdomain_indices.end());
2103 index_set.
add_indices(subdomain_indices.begin(), subdomain_indices.end());
2111 template <
int dim,
int spacedim>
2116 std::vector<unsigned int> &n_dofs_on_subdomain)
2121 std::fill(n_dofs_on_subdomain.begin(), n_dofs_on_subdomain.end(), 0);
2130 return cell.subdomain_id() == subdomain;
2132 ExcMessage(
"There are no cells for the given subdomain!"));
2134 std::vector<types::subdomain_id> subdomain_association(
2138 std::vector<unsigned char> component_association(dof_handler.
n_dofs());
2141 component_association);
2143 for (
unsigned int c = 0; c < dof_handler.
get_fe(0).n_components(); ++c)
2146 if ((subdomain_association[i] == subdomain) &&
2147 (component_association[i] ==
static_cast<unsigned char>(c)))
2148 ++n_dofs_on_subdomain[c];
2160 template <
int dim,
int spacedim>
2163 const std::vector<unsigned char> &dofs_by_component,
2164 const std::vector<unsigned int> &target_component,
2165 const bool only_once,
2166 std::vector<types::global_dof_index> &dofs_per_component,
2167 unsigned int &component)
2186 for (
unsigned int dd = 0; dd < d; ++dd, ++component)
2187 dofs_per_component[target_component[component]] +=
2188 std::count(dofs_by_component.begin(),
2189 dofs_by_component.end(),
2196 for (
unsigned int dd = 1; dd < d; ++dd)
2197 dofs_per_component[target_component[component - d + dd]] =
2198 dofs_per_component[target_component[component - d]];
2205 template <
int dim,
int spacedim>
2208 const std::vector<unsigned char> &dofs_by_component,
2209 const std::vector<unsigned int> &target_component,
2210 const bool only_once,
2211 std::vector<types::global_dof_index> &dofs_per_component,
2212 unsigned int &component)
2217 for (
unsigned int fe = 1; fe < fe_collection.
size(); ++fe)
2219 Assert(fe_collection[fe].n_components() ==
2220 fe_collection[0].n_components(),
2222 Assert(fe_collection[fe].n_base_elements() ==
2223 fe_collection[0].n_base_elements(),
2225 for (
unsigned int b = 0; b < fe_collection[0].n_base_elements(); ++b)
2227 Assert(fe_collection[fe].base_element(b).n_components() ==
2228 fe_collection[0].base_element(b).n_components(),
2230 Assert(fe_collection[fe].base_element(b).n_base_elements() ==
2231 fe_collection[0].base_element(b).n_base_elements(),
2255 template <
int dim,
int spacedim>
2257 all_elements_are_primitive(
2258 const ::hp::FECollection<dim, spacedim> &fe_collection)
2260 for (
unsigned int i = 0; i < fe_collection.size(); ++i)
2261 if (fe_collection[i].is_primitive() ==
false)
2271 template <
int dim,
int spacedim>
2272 std::vector<types::global_dof_index>
2275 const bool only_once,
2276 const std::vector<unsigned int> &target_component_)
2282 std::vector<unsigned int> target_component = target_component_;
2283 if (target_component.empty())
2285 target_component.resize(n_components);
2286 for (
unsigned int i = 0; i < n_components; ++i)
2287 target_component[i] = i;
2290 Assert(target_component.size() == n_components,
2294 const unsigned int max_component =
2295 *std::max_element(target_component.begin(), target_component.end());
2296 const unsigned int n_target_components = max_component + 1;
2298 std::vector<types::global_dof_index> dofs_per_component(
2303 if (n_components == 1)
2306 return dofs_per_component;
2312 std::vector<unsigned char> dofs_by_component(
2319 unsigned int component = 0;
2330 Assert((internal::all_elements_are_primitive(
2332 (std::accumulate(dofs_per_component.begin(),
2333 dofs_per_component.end(),
2339#ifdef DEAL_II_WITH_MPI
2345 std::vector<types::global_dof_index> local_dof_count =
2348 const int ierr = MPI_Allreduce(
2349 local_dof_count.data(),
2350 dofs_per_component.data(),
2351 n_target_components,
2352 Utilities::MPI::mpi_type_id_for_type<types::global_dof_index>,
2354 tria->get_mpi_communicator());
2359 return dofs_per_component;
2364 template <
int dim,
int spacedim>
2365 std::vector<types::global_dof_index>
2367 const std::vector<unsigned int> &target_block_)
2369 const ::hp::FECollection<dim, spacedim> &fe_collection =
2378 const unsigned int n_blocks = fe_collection[0].n_blocks();
2380 std::vector<unsigned int> target_block = target_block_;
2381 if (target_block.empty())
2383 target_block.resize(fe_collection[0].n_blocks());
2384 for (
unsigned int i = 0; i < n_blocks; ++i)
2385 target_block[i] = i;
2388 Assert(target_block.size() == n_blocks,
2390 for (
unsigned int f = 1; f < fe_collection.size(); ++f)
2391 Assert(fe_collection[0].n_blocks() == fe_collection[f].n_blocks(),
2392 ExcMessage(
"This function can only work if all elements in a "
2393 "collection have the same number of blocks."));
2399 std::vector<types::global_dof_index> dofs_per_block(1);
2400 dofs_per_block[0] = dof_handler.
n_dofs();
2401 return dofs_per_block;
2405 const unsigned int max_block =
2406 *std::max_element(target_block.begin(), target_block.end());
2407 const unsigned int n_target_blocks = max_block + 1;
2409 std::vector<types::global_dof_index> dofs_per_block(n_target_blocks);
2413 for (
unsigned int this_fe = fe_collection.size() - 1;
2414 this_fe < fe_collection.size();
2419 std::vector<unsigned char> dofs_by_block(
2424 for (
unsigned int block = 0; block < fe.
n_blocks(); ++block)
2425 dofs_per_block[target_block[block]] +=
2426 std::count(dofs_by_block.begin(), dofs_by_block.end(), block);
2428#ifdef DEAL_II_WITH_MPI
2435 std::vector<types::global_dof_index> local_dof_count =
2437 const int ierr = MPI_Allreduce(
2438 local_dof_count.data(),
2439 dofs_per_block.data(),
2441 Utilities::MPI::mpi_type_id_for_type<types::global_dof_index>,
2443 tria->get_mpi_communicator());
2449 return dofs_per_block;
2454 template <
int dim,
int spacedim>
2457 std::vector<types::global_dof_index> &mapping)
2460 mapping.insert(mapping.end(),
2464 std::vector<types::global_dof_index> dofs_on_face;
2475 for (
const unsigned int f : cell->face_indices())
2476 if (cell->at_boundary(f))
2478 const unsigned int dofs_per_face =
2479 cell->get_fe().n_dofs_per_face(f);
2480 dofs_on_face.resize(dofs_per_face);
2481 cell->face(f)->get_dof_indices(dofs_on_face,
2482 cell->active_fe_index());
2483 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2485 mapping[dofs_on_face[i]] = next_boundary_index++;
2493 template <
int dim,
int spacedim>
2496 const std::set<types::boundary_id> &boundary_ids,
2497 std::vector<types::global_dof_index> &mapping)
2504 mapping.insert(mapping.end(),
2509 if (boundary_ids.empty())
2512 std::vector<types::global_dof_index> dofs_on_face;
2517 for (
const unsigned int f : cell->face_indices())
2518 if (boundary_ids.find(cell->face(f)->boundary_id()) !=
2521 const unsigned int dofs_per_face =
2522 cell->get_fe().n_dofs_per_face(f);
2523 dofs_on_face.resize(dofs_per_face);
2524 cell->face(f)->get_dof_indices(dofs_on_face,
2525 cell->active_fe_index());
2526 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2528 mapping[dofs_on_face[i]] = next_boundary_index++;
2539 template <
int dim,
int spacedim>
2540 std::map<types::global_dof_index, Point<spacedim>>
2545 const bool map_locally_relevant_dofs)
2547 std::map<types::global_dof_index, Point<spacedim>> support_points;
2555 (in_mask.
size() == 0 ?
2559 for (
unsigned int fe_index = 0; fe_index < fe_collection.
size();
2564 (fe_collection[fe_index].get_sub_fe(mask).n_dofs_per_cell() ==
2566 (fe_collection[fe_index].get_sub_fe(mask).has_support_points()),
2571 .get_unit_support_points()));
2589 std::vector<types::global_dof_index> local_dof_indices;
2590 for (
const auto &cell : dof_handler.active_cell_iterators())
2595 if ((cell->is_artificial() == false) &&
2596 (map_locally_relevant_dofs || cell->is_locally_owned()) &&
2597 (cell->get_fe().n_dofs_per_cell() > 0))
2599 hp_fe_values.reinit(cell);
2603 local_dof_indices.resize(cell->get_fe().n_dofs_per_cell());
2604 cell->get_dof_indices(local_dof_indices);
2606 const std::vector<Point<spacedim>> &points =
2614 for (
unsigned int i = 0; i < cell->get_fe().n_dofs_per_cell();
2617 const unsigned int dof_comp =
2618 cell->get_fe().system_to_component_index(i).first;
2639 support_points.find(local_dof_indices[i]);
2647 if (it != support_points.end())
2649 const auto p = cell->get_fe().tensor_degree();
2650 Assert((it->second - points[point_index]).norm() <
2651 cell->diameter() / (4.0 * p * p),
2656 if (map_locally_relevant_dofs ||
2657 locally_owned_dofs.
is_element(local_dof_indices[i]))
2658 support_points[local_dof_indices[i]] =
2666 return support_points;
2670 template <
int dim,
int spacedim>
2671 std::vector<Point<spacedim>>
2672 map_dofs_to_support_points_vector(
2676 const bool map_locally_relevant_dofs)
2678 std::vector<Point<spacedim>> support_points(dof_handler.
n_dofs());
2681 const std::map<types::global_dof_index, Point<spacedim>>
2683 mapping, dof_handler, mask, map_locally_relevant_dofs);
2689 Assert(x_support_points.find(i) != x_support_points.end(),
2692 support_points[i] = x_support_points.find(i)->second;
2695 return support_points;
2701 template <
int dim,
int spacedim>
2707 const bool map_locally_relevant_dofs)
2714 "This function can not be used with distributed triangulations. "
2715 "See the documentation for more information."));
2721 support_points = internal::map_dofs_to_support_points_vector(
2722 mapping_collection, dof_handler, mask, map_locally_relevant_dofs);
2726 template <
int dim,
int spacedim>
2733 const bool map_locally_relevant_dofs)
2740 "This function can not be used with distributed triangulations. "
2741 "See the documentation for more information."));
2745 support_points = internal::map_dofs_to_support_points_vector(
2746 mapping, dof_handler, mask, map_locally_relevant_dofs);
2750 template <
int dim,
int spacedim>
2751 std::map<types::global_dof_index, Point<spacedim>>
2755 const bool map_locally_relevant_dofs)
2761 return internal::map_dofs_to_support_points(mapping_collection,
2764 map_locally_relevant_dofs);
2768 template <
int dim,
int spacedim>
2769 std::map<types::global_dof_index, Point<spacedim>>
2774 const bool map_locally_relevant_dofs)
2776 return internal::map_dofs_to_support_points(mapping,
2779 map_locally_relevant_dofs);
2783 template <
int spacedim>
2791 std::map<Point<spacedim>,
2792 std::vector<types::global_dof_index>,
2797 for (
const auto &it : support_points)
2799 std::vector<types::global_dof_index> &v = point_map[it.second];
2800 v.push_back(it.first);
2804 for (
const auto &it : point_map)
2806 out << it.first <<
" \"";
2807 const std::vector<types::global_dof_index> &v = it.second;
2808 for (
unsigned int i = 0; i < v.size(); ++i)
2822 template <
int dim,
int spacedim>
2831 const unsigned int nb = fe.
n_blocks();
2833 tables_by_block.resize(1);
2834 tables_by_block[0].reinit(nb, nb);
2835 tables_by_block[0].fill(
none);
2843 tables_by_block[0](ib, jb) |= table(i, j);
2851 tables_by_block.resize(fe_collection.
size());
2853 for (
unsigned int f = 0; f < fe_collection.
size(); ++f)
2857 const unsigned int nb = fe.
n_blocks();
2858 tables_by_block[f].reinit(nb, nb);
2859 tables_by_block[f].fill(
none);
2866 tables_by_block[f](ib, jb) |= table(i, j);
2875 template <
int dim,
int spacedim>
2879 const unsigned int level,
2880 const std::vector<bool> &selected_dofs,
2883 std::vector<types::global_dof_index> indices;
2888 if (cell->is_locally_owned_on_level())
2895 if (cell->is_locally_owned_on_level())
2897 indices.resize(cell->get_fe().n_dofs_per_cell());
2898 cell->get_mg_dof_indices(indices);
2900 if (selected_dofs.size() != 0)
2905 if (selected_dofs.empty())
2906 block_list.
add(i, indices[j] - offset);
2909 if (selected_dofs[j])
2910 block_list.
add(i, indices[j] - offset);
2918 template <
int dim,
int spacedim>
2922 const unsigned int level,
2923 const bool interior_only)
2928 std::vector<types::global_dof_index> indices;
2929 std::vector<bool> exclude;
2933 indices.resize(cell->get_fe().n_dofs_per_cell());
2934 cell->get_mg_dof_indices(indices);
2940 std::fill(exclude.begin(), exclude.end(),
false);
2942 for (
const unsigned int face : cell->face_indices())
2943 if (cell->at_boundary(face) ||
2944 cell->neighbor(face)->level() != cell->level())
2949 block_list.
add(0, indices[j]);
2953 for (
const auto index : indices)
2954 block_list.
add(0, index);
2960 template <
int dim,
int spacedim>
2964 const unsigned int level,
2965 const bool interior_dofs_only,
2966 const bool boundary_dofs)
2971 std::vector<types::global_dof_index> indices;
2972 std::vector<bool> exclude;
2974 unsigned int block = 0;
2977 if (pcell->is_active())
2980 for (
unsigned int child = 0; child < pcell->n_children(); ++child)
2982 const auto cell = pcell->child(child);
2987 indices.resize(n_dofs);
2988 exclude.resize(n_dofs);
2989 std::fill(exclude.begin(), exclude.end(),
false);
2990 cell->get_mg_dof_indices(indices);
2992 if (interior_dofs_only)
2996 for (
unsigned int d = 0; d < dim; ++d)
2998 const unsigned int face =
3007 for (
const unsigned int face :
3009 if (cell->at_boundary(face))
3015 for (
unsigned int i = 0; i < n_dofs; ++i)
3017 block_list.
add(block, indices[i]);
3023 template <
int dim,
int spacedim>
3024 std::vector<unsigned int>
3027 const unsigned int level,
3028 const bool interior_only,
3029 const bool boundary_patches,
3030 const bool level_boundary_patches,
3031 const bool single_cell_patches,
3032 const bool invert_vertex_mapping)
3039 exclude_boundary_dofs,
3041 level_boundary_patches,
3042 single_cell_patches,
3043 invert_vertex_mapping);
3046 template <
int dim,
int spacedim>
3047 std::vector<unsigned int>
3050 const unsigned int level,
3052 const bool boundary_patches,
3053 const bool level_boundary_patches,
3054 const bool single_cell_patches,
3055 const bool invert_vertex_mapping)
3059 std::vector<unsigned int> vertex_cell_count(
3063 std::vector<bool> vertex_boundary(
3066 std::vector<unsigned int> vertex_mapping(
3071 std::vector<unsigned int> vertex_dof_count(
3077 for (
const unsigned int v : cell->vertex_indices())
3079 const unsigned int vg = cell->vertex_index(v);
3080 vertex_dof_count[vg] += cell->get_fe().n_dofs_per_cell();
3081 ++vertex_cell_count[vg];
3082 for (
unsigned int d = 0; d < dim; ++d)
3085 if (cell->at_boundary(face))
3086 vertex_boundary[vg] =
true;
3087 else if ((!level_boundary_patches) &&
3088 (cell->neighbor(face)->level() !=
3089 static_cast<int>(
level)))
3090 vertex_boundary[vg] =
true;
3096 for (
unsigned int vg = 0; vg < vertex_dof_count.size(); ++vg)
3097 if ((!single_cell_patches && vertex_cell_count[vg] < 2) ||
3098 (!boundary_patches && vertex_boundary[vg]))
3099 vertex_dof_count[vg] = 0;
3102 unsigned int n_vertex_count = 0;
3103 for (
unsigned int vg = 0; vg < vertex_mapping.size(); ++vg)
3104 if (vertex_dof_count[vg] != 0)
3105 vertex_mapping[vg] = n_vertex_count++;
3108 for (
unsigned int vg = 0; vg < vertex_mapping.size(); ++vg)
3109 if (vertex_dof_count[vg] != 0)
3110 vertex_dof_count[vertex_mapping[vg]] = vertex_dof_count[vg];
3114 vertex_dof_count.resize(n_vertex_count);
3118 block_list.
reinit(vertex_dof_count.size(),
3122 std::vector<types::global_dof_index> indices;
3123 std::vector<bool> exclude;
3129 cell->get_mg_dof_indices(indices);
3131 for (
const unsigned int v : cell->vertex_indices())
3133 const unsigned int vg = cell->vertex_index(v);
3134 const unsigned int block = vertex_mapping[vg];
3140 if (exclude_boundary_dofs.
size() == 0 ||
3146 std::fill(exclude.begin(), exclude.end(),
false);
3148 for (
unsigned int d = 0; d < dim; ++d)
3150 const unsigned int a_face =
3152 const unsigned int face =
3165 for (
unsigned int j = 0; j < indices.size(); ++j)
3167 block_list.
add(block, indices[j]);
3171 for (
const auto index : indices)
3172 block_list.
add(block, index);
3177 if (invert_vertex_mapping)
3180 unsigned int n_vertex_count = 0;
3181 for (
unsigned int vg = 0; vg < vertex_mapping.size(); ++vg)
3183 vertex_mapping[n_vertex_count++] = vg;
3186 vertex_mapping.resize(n_vertex_count);
3189 return vertex_mapping;
3193 template <
int dim,
int spacedim>
3199 std::set<types::global_dof_index> dofs_on_patch;
3200 std::vector<types::global_dof_index> local_dof_indices;
3205 for (
unsigned int i = 0; i < patch.size(); ++i)
3209 Assert(cell->is_artificial() ==
false,
3210 ExcMessage(
"This function can not be called with cells that are "
3211 "not either locally owned or ghost cells."));
3213 cell->get_dof_indices(local_dof_indices);
3214 dofs_on_patch.insert(local_dof_indices.begin(),
3215 local_dof_indices.end());
3219 return dofs_on_patch.size();
3224 template <
int dim,
int spacedim>
3225 std::vector<types::global_dof_index>
3230 std::set<types::global_dof_index> dofs_on_patch;
3231 std::vector<types::global_dof_index> local_dof_indices;
3236 for (
unsigned int i = 0; i < patch.size(); ++i)
3240 Assert(cell->is_artificial() ==
false,
3241 ExcMessage(
"This function can not be called with cells that are "
3242 "not either locally owned or ghost cells."));
3244 cell->get_dof_indices(local_dof_indices);
3245 dofs_on_patch.insert(local_dof_indices.begin(),
3246 local_dof_indices.end());
3249 Assert((dofs_on_patch.size() == count_dofs_on_patch<dim, spacedim>(patch)),
3256 return std::vector<types::global_dof_index>(dofs_on_patch.begin(),
3257 dofs_on_patch.end());
3267#include "dofs/dof_tools.inst"
* * for(const auto &cell :triangulation.active_cell_iterators())
* * const_iterator()=default
const IndexSet & get_local_lines() const
const std::vector< std::pair< size_type, number > > * get_constraint_entries(const size_type line_n) const
size_type n_constraints() const
unsigned int size() const
unsigned int n_selected_blocks(const unsigned int overall_number_of_blocks=numbers::invalid_unsigned_int) const
bool represents_n_components(const unsigned int n) const
bool represents_the_all_selected_mask() const
unsigned int size() const
unsigned int n_selected_components(const unsigned int overall_number_of_components=numbers::invalid_unsigned_int) const
unsigned int first_selected_component(const unsigned int overall_number_of_components=numbers::invalid_unsigned_int) const
const hp::FECollection< dim, spacedim > & get_fe_collection() const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
const IndexSet & locally_owned_mg_dofs(const unsigned int level) const
types::global_dof_index n_boundary_dofs() const
const Triangulation< dim, spacedim > & get_triangulation() const
const IndexSet & locally_owned_dofs() const
active_cell_iterator begin_active(const unsigned int level=0) const
bool has_hp_capabilities() const
types::global_dof_index n_dofs() const
MPI_Comm get_mpi_communicator() const
types::global_dof_index n_locally_owned_dofs() const
virtual double value(const Point< dim > &p, const unsigned int component) const override
RigidBodyMotion(const unsigned int type)
static constexpr unsigned int n_modes
const std::vector< Point< spacedim > > & get_quadrature_points() const
const FEValues< dim, spacedim > & get_present_fe_values() const
unsigned int n_dofs_per_vertex() const
unsigned int n_dofs_per_cell() const
unsigned int n_dofs_per_line() const
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
unsigned int n_blocks() const
unsigned int n_components() const
std::pair< unsigned int, types::global_dof_index > system_to_block_index(const unsigned int component) const
const ComponentMask & get_nonzero_components(const unsigned int i) const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
bool is_primitive() const
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
unsigned int component_to_block_index(const unsigned int component) const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
unsigned int element_multiplicity(const unsigned int index) const
virtual unsigned int face_to_cell_index(const unsigned int face_dof_index, const unsigned int face, const types::geometric_orientation combined_orientation=numbers::default_geometric_orientation) const
unsigned int n_base_elements() const
std::pair< unsigned int, unsigned int > face_system_to_component_index(const unsigned int index, const unsigned int face_no=0) const
const unsigned int n_components
size_type index_within_set(const size_type global_index) const
size_type n_elements() const
bool is_element(const size_type index) const
void add_index(const size_type index)
void fill_binary_vector(VectorType &vector) const
void subtract_set(const IndexSet &other)
size_type nth_index_in_set(const size_type local_index) const
void add_indices(const ForwardIterator &begin, const ForwardIterator &end)
Abstract base class for mapping classes.
void reinit(const size_type m, const size_type n, const ArrayView< const unsigned int > &row_lengths)
void add(const size_type i, const size_type j)
virtual types::subdomain_id locally_owned_subdomain() const
unsigned int n_active_cells() const
unsigned int n_levels() const
unsigned int n_vertices() const
virtual size_type size() const override
unsigned int size() const
unsigned int max_dofs_per_face() const
ComponentMask component_mask(const FEValuesExtractors::Scalar &scalar) const
unsigned int n_components() const
unsigned int max_dofs_per_cell() const
void push_back(const Quadrature< dim_in > &new_quadrature)
virtual MPI_Comm get_mpi_communicator() const override
#define DEAL_II_NAMESPACE_OPEN
constexpr bool running_in_debug_mode()
#define DEAL_II_NAMESPACE_CLOSE
IteratorRange< active_cell_iterator > active_cell_iterators() const
IteratorRange< FilteredIterator< BaseIterator > > filter_iterators(IteratorRange< BaseIterator > i, const Predicate &p)
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
static ::ExceptionBase & ExcIO()
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertThrowMPI(error_code)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcIndexRange(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
typename ActiveSelector::line_iterator line_iterator
typename ActiveSelector::face_iterator face_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
typename ActiveSelector::CellAccessor cell_accessor
@ update_quadrature_points
Transformed quadrature points.
std::vector< index_type > data
* * if(update_pressure &update_flags) * compute_pressure(constitutive_request
std::map< unsigned int, T > some_to_some(const MPI_Comm comm, const std::map< unsigned int, T > &objects_to_send)
unsigned int n_mpi_processes(const MPI_Comm mpi_communicator)
constexpr types::global_dof_index invalid_dof_index
constexpr unsigned int invalid_unsigned_int
constexpr types::boundary_id internal_face_boundary_id
constexpr types::subdomain_id artificial_subdomain_id
constexpr types::subdomain_id invalid_subdomain_id
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
unsigned short int fe_index
static std_cxx20::ranges::iota_view< unsigned int, unsigned int > face_indices()