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();
322 cell->get_dof_indices(indices);
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();
386 cell->get_dof_indices(dof_indices);
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>
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]);
691 const unsigned int cell_index =
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()) !=
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();
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;
1052 IndexSet selected_dofs(dof_handler.
n_dofs());
1054 const FiniteElement<dim, spacedim> &fe = dof_handler.
get_fe();
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;
1096 IndexSet selected_dofs(dof_handler.
n_dofs());
1097 IndexSet unconstrained_dofs(dof_handler.
n_dofs());
1099 const FiniteElement<dim, spacedim> &fe = dof_handler.
get_fe();
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();
1169 cell->get_dof_indices(local_dof_indices);
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)
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>
1785 std::vector<unsigned int> &active_fe_indices)
1792 active_fe_indices.assign(indices.begin(), indices.end());
1795 template <
int dim,
int spacedim>
1796 std::vector<IndexSet>
1800 ExcMessage(
"The given DoFHandler has no DoFs."));
1808 "For parallel::distributed::Triangulation objects and "
1809 "associated DoF handler objects, asking for any information "
1810 "related to a subdomain other than the locally owned one does "
1811 "not make sense."));
1815 std::vector<::types::subdomain_id> subdomain_association(
1818 subdomain_association);
1832 const unsigned int n_subdomains =
1836 unsigned int max_subdomain_id = 0;
1839 std::max(max_subdomain_id, cell->subdomain_id());
1840 return max_subdomain_id + 1;
1846 Assert(n_subdomains > *std::max_element(subdomain_association.begin(),
1847 subdomain_association.end()),
1850 std::vector<::IndexSet> index_sets(
1859 index < subdomain_association.size();
1863 if (subdomain_association[index] != this_subdomain)
1865 index_sets[this_subdomain].add_range(i_min, index);
1867 this_subdomain = subdomain_association[index];
1872 if (i_min == subdomain_association.size() - 1)
1874 index_sets[this_subdomain].add_index(i_min);
1880 index_sets[this_subdomain].add_range(i_min,
1881 subdomain_association.size());
1884 for (
unsigned int i = 0; i < n_subdomains; ++i)
1885 index_sets[i].compress();
1890 template <
int dim,
int spacedim>
1891 std::vector<IndexSet>
1901 "For parallel::distributed::Triangulation objects and "
1902 "associated DoF handler objects, asking for any information "
1903 "related to a subdomain other than the locally owned one does "
1904 "not make sense."));
1912 std::vector<IndexSet> dof_set =
1914 const ::types::subdomain_id n_subdomains = dof_set.size();
1920 subdomain_id < n_subdomains;
1933 std::vector<types::global_dof_index> local_dof_indices;
1934 std::set<types::global_dof_index> subdomain_halo_global_dof_indices;
1935 for (
typename std::vector<
1937 const_iterator it_cell = active_halo_layer.begin();
1938 it_cell != active_halo_layer.end();
1944 cell->subdomain_id() != subdomain_id,
1946 "The subdomain ID of the halo cell should not match that of the vector entry."));
1949 cell->get_dof_indices(local_dof_indices);
1953 subdomain_halo_global_dof_indices.insert(local_dof_index);
1956 dof_set[subdomain_id].add_indices(
1957 subdomain_halo_global_dof_indices.begin(),
1958 subdomain_halo_global_dof_indices.end());
1960 dof_set[subdomain_id].compress();
1966 template <
int dim,
int spacedim>
1970 std::vector<types::subdomain_id> &subdomain_association)
1978 "For parallel::distributed::Triangulation objects and "
1979 "associated DoF handler objects, asking for any subdomain other "
1980 "than the locally owned one does not make sense."));
1982 Assert(subdomain_association.size() == dof_handler.
n_dofs(),
1996 std::vector<types::subdomain_id> cell_owners(
2002 cell_owners = tr->get_true_subdomain_ids_of_cells();
2003 Assert(tr->get_true_subdomain_ids_of_cells().size() ==
2004 tr->n_active_cells(),
2011 cell_owners[cell->active_cell_index()] = cell->subdomain_id();
2015 std::fill_n(subdomain_association.begin(),
2019 std::vector<types::global_dof_index> local_dof_indices;
2020 local_dof_indices.reserve(
2028 cell_owners[cell->active_cell_index()];
2029 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
2031 cell->get_dof_indices(local_dof_indices);
2038 if (subdomain_association[local_dof_indices[i]] ==
2040 subdomain_association[local_dof_indices[i]] = subdomain_id;
2041 else if (subdomain_association[local_dof_indices[i]] > subdomain_id)
2043 subdomain_association[local_dof_indices[i]] = subdomain_id;
2047 Assert(std::find(subdomain_association.begin(),
2048 subdomain_association.end(),
2050 subdomain_association.end(),
2056 template <
int dim,
int spacedim>
2062 std::vector<types::subdomain_id> subdomain_association(
2066 return std::count(subdomain_association.begin(),
2067 subdomain_association.end(),
2073 template <
int dim,
int spacedim>
2086 "For parallel::distributed::Triangulation objects and "
2087 "associated DoF handler objects, asking for any subdomain other "
2088 "than the locally owned one does not make sense."));
2092 std::vector<types::global_dof_index> local_dof_indices;
2093 local_dof_indices.reserve(
2101 std::vector<types::global_dof_index> subdomain_indices;
2104 if ((cell->is_artificial() ==
false) &&
2105 (cell->subdomain_id() == subdomain))
2107 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
2109 cell->get_dof_indices(local_dof_indices);
2110 subdomain_indices.insert(subdomain_indices.end(),
2111 local_dof_indices.begin(),
2112 local_dof_indices.end());
2115 std::sort(subdomain_indices.begin(), subdomain_indices.end());
2116 index_set.
add_indices(subdomain_indices.begin(), subdomain_indices.end());
2124 template <
int dim,
int spacedim>
2129 std::vector<unsigned int> &n_dofs_on_subdomain)
2134 std::fill(n_dofs_on_subdomain.begin(), n_dofs_on_subdomain.end(), 0);
2143 return cell.subdomain_id() == subdomain;
2145 ExcMessage(
"There are no cells for the given subdomain!"));
2147 std::vector<types::subdomain_id> subdomain_association(
2151 std::vector<unsigned char> component_association(dof_handler.
n_dofs());
2154 component_association);
2156 for (
unsigned int c = 0; c < dof_handler.
get_fe(0).n_components(); ++c)
2159 if ((subdomain_association[i] == subdomain) &&
2160 (component_association[i] ==
static_cast<unsigned char>(c)))
2161 ++n_dofs_on_subdomain[c];
2173 template <
int dim,
int spacedim>
2176 const std::vector<unsigned char> &dofs_by_component,
2177 const std::vector<unsigned int> &target_component,
2178 const bool only_once,
2179 std::vector<types::global_dof_index> &dofs_per_component,
2180 unsigned int &component)
2199 for (
unsigned int dd = 0; dd < d; ++dd, ++component)
2200 dofs_per_component[target_component[component]] +=
2201 std::count(dofs_by_component.begin(),
2202 dofs_by_component.end(),
2209 for (
unsigned int dd = 1; dd < d; ++dd)
2210 dofs_per_component[target_component[component - d + dd]] =
2211 dofs_per_component[target_component[component - d]];
2218 template <
int dim,
int spacedim>
2221 const std::vector<unsigned char> &dofs_by_component,
2222 const std::vector<unsigned int> &target_component,
2223 const bool only_once,
2224 std::vector<types::global_dof_index> &dofs_per_component,
2225 unsigned int &component)
2230 for (
unsigned int fe = 1; fe < fe_collection.
size(); ++fe)
2232 Assert(fe_collection[fe].n_components() ==
2233 fe_collection[0].n_components(),
2235 Assert(fe_collection[fe].n_base_elements() ==
2236 fe_collection[0].n_base_elements(),
2238 for (
unsigned int b = 0; b < fe_collection[0].n_base_elements(); ++b)
2240 Assert(fe_collection[fe].base_element(b).n_components() ==
2241 fe_collection[0].base_element(b).n_components(),
2243 Assert(fe_collection[fe].base_element(b).n_base_elements() ==
2244 fe_collection[0].base_element(b).n_base_elements(),
2267 template <
int dim,
int spacedim>
2279 template <
int dim,
int spacedim>
2281 all_elements_are_primitive(
2282 const ::hp::FECollection<dim, spacedim> &fe_collection)
2284 for (
unsigned int i = 0; i < fe_collection.size(); ++i)
2285 if (fe_collection[i].is_primitive() ==
false)
2295 template <
int dim,
int spacedim>
2296 std::vector<types::global_dof_index>
2299 const bool only_once,
2300 const std::vector<unsigned int> &target_component_)
2306 std::vector<unsigned int> target_component = target_component_;
2307 if (target_component.empty())
2309 target_component.resize(n_components);
2310 for (
unsigned int i = 0; i < n_components; ++i)
2311 target_component[i] = i;
2314 Assert(target_component.size() == n_components,
2318 const unsigned int max_component =
2319 *std::max_element(target_component.begin(), target_component.end());
2320 const unsigned int n_target_components = max_component + 1;
2322 std::vector<types::global_dof_index> dofs_per_component(
2327 if (n_components == 1)
2330 return dofs_per_component;
2336 std::vector<unsigned char> dofs_by_component(
2343 unsigned int component = 0;
2354 Assert((internal::all_elements_are_primitive(
2356 (std::accumulate(dofs_per_component.begin(),
2357 dofs_per_component.end(),
2363#ifdef DEAL_II_WITH_MPI
2369 std::vector<types::global_dof_index> local_dof_count =
2372 const int ierr = MPI_Allreduce(
2373 local_dof_count.data(),
2374 dofs_per_component.data(),
2375 n_target_components,
2378 tria->get_mpi_communicator());
2383 return dofs_per_component;
2388 template <
int dim,
int spacedim>
2389 std::vector<types::global_dof_index>
2391 const std::vector<unsigned int> &target_block_)
2393 const ::hp::FECollection<dim, spacedim> &fe_collection =
2402 const unsigned int n_blocks = fe_collection[0].n_blocks();
2404 std::vector<unsigned int> target_block = target_block_;
2405 if (target_block.empty())
2407 target_block.resize(fe_collection[0].n_blocks());
2408 for (
unsigned int i = 0; i < n_blocks; ++i)
2409 target_block[i] = i;
2412 Assert(target_block.size() == n_blocks,
2414 for (
unsigned int f = 1; f < fe_collection.size(); ++f)
2415 Assert(fe_collection[0].n_blocks() == fe_collection[f].n_blocks(),
2416 ExcMessage(
"This function can only work if all elements in a "
2417 "collection have the same number of blocks."));
2423 std::vector<types::global_dof_index> dofs_per_block(1);
2424 dofs_per_block[0] = dof_handler.
n_dofs();
2425 return dofs_per_block;
2429 const unsigned int max_block =
2430 *std::max_element(target_block.begin(), target_block.end());
2431 const unsigned int n_target_blocks = max_block + 1;
2433 std::vector<types::global_dof_index> dofs_per_block(n_target_blocks);
2437 for (
unsigned int this_fe = fe_collection.size() - 1;
2438 this_fe < fe_collection.size();
2443 std::vector<unsigned char> dofs_by_block(
2448 for (
unsigned int block = 0; block < fe.
n_blocks(); ++block)
2449 dofs_per_block[target_block[block]] +=
2450 std::count(dofs_by_block.begin(), dofs_by_block.end(), block);
2452#ifdef DEAL_II_WITH_MPI
2459 std::vector<types::global_dof_index> local_dof_count =
2461 const int ierr = MPI_Allreduce(
2462 local_dof_count.data(),
2463 dofs_per_block.data(),
2467 tria->get_mpi_communicator());
2473 return dofs_per_block;
2478 template <
int dim,
int spacedim>
2481 std::vector<types::global_dof_index> &
mapping)
2488 std::vector<types::global_dof_index> dofs_on_face;
2499 for (
const unsigned int f : cell->face_indices())
2500 if (cell->at_boundary(f))
2502 const unsigned int dofs_per_face =
2503 cell->get_fe().n_dofs_per_face(f);
2504 dofs_on_face.resize(dofs_per_face);
2505 cell->face(f)->get_dof_indices(dofs_on_face,
2506 cell->active_fe_index());
2507 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2509 mapping[dofs_on_face[i]] = next_boundary_index++;
2517 template <
int dim,
int spacedim>
2520 const std::set<types::boundary_id> &boundary_ids,
2521 std::vector<types::global_dof_index> &
mapping)
2533 if (boundary_ids.empty())
2536 std::vector<types::global_dof_index> dofs_on_face;
2541 for (
const unsigned int f : cell->face_indices())
2542 if (boundary_ids.find(cell->face(f)->boundary_id()) !=
2545 const unsigned int dofs_per_face =
2546 cell->get_fe().n_dofs_per_face(f);
2547 dofs_on_face.resize(dofs_per_face);
2548 cell->face(f)->get_dof_indices(dofs_on_face,
2549 cell->active_fe_index());
2550 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2552 mapping[dofs_on_face[i]] = next_boundary_index++;
2563 template <
int dim,
int spacedim>
2564 std::map<types::global_dof_index, Point<spacedim>>
2569 const bool map_locally_relevant_dofs)
2571 std::map<types::global_dof_index, Point<spacedim>> support_points;
2579 (in_mask.
size() == 0 ?
2583 for (
unsigned int fe_index = 0; fe_index < fe_collection.
size();
2588 (fe_collection[fe_index].get_sub_fe(mask).n_dofs_per_cell() ==
2590 (fe_collection[fe_index].get_sub_fe(mask).has_support_points()),
2595 .get_unit_support_points()));
2607 hp::FEValues<dim, spacedim> hp_fe_values(
mapping,
2613 std::vector<types::global_dof_index> local_dof_indices;
2619 if ((cell->is_artificial() ==
false) &&
2620 (map_locally_relevant_dofs || cell->is_locally_owned()) &&
2621 (cell->get_fe().n_dofs_per_cell() > 0))
2623 hp_fe_values.reinit(cell);
2624 const FEValues<dim, spacedim> &fe_values =
2625 hp_fe_values.get_present_fe_values();
2627 local_dof_indices.resize(cell->get_fe().n_dofs_per_cell());
2628 cell->get_dof_indices(local_dof_indices);
2630 const std::vector<Point<spacedim>> &points =
2638 for (
unsigned int i = 0; i < cell->get_fe().n_dofs_per_cell();
2641 const unsigned int dof_comp =
2642 cell->get_fe().system_to_component_index(i).first;
2663 support_points.find(local_dof_indices[i]);
2671 if (it != support_points.end())
2673 const auto p = cell->get_fe().tensor_degree();
2674 Assert((it->second - points[point_index]).norm() <
2675 cell->diameter() / (4.0 * p * p),
2680 if (map_locally_relevant_dofs ||
2681 locally_owned_dofs.
is_element(local_dof_indices[i]))
2682 support_points[local_dof_indices[i]] =
2690 return support_points;
2694 template <
int dim,
int spacedim>
2695 std::vector<Point<spacedim>>
2696 map_dofs_to_support_points_vector(
2697 const hp::MappingCollection<dim, spacedim> &
mapping,
2698 const DoFHandler<dim, spacedim> &dof_handler,
2699 const ComponentMask &mask,
2700 const bool map_locally_relevant_dofs)
2702 std::vector<Point<spacedim>> support_points(dof_handler.
n_dofs());
2705 const std::map<types::global_dof_index, Point<spacedim>>
2707 mapping, dof_handler, mask, map_locally_relevant_dofs);
2713 Assert(x_support_points.find(i) != x_support_points.end(),
2716 support_points[i] = x_support_points.find(i)->second;
2719 return support_points;
2725 template <
int dim,
int spacedim>
2731 const bool map_locally_relevant_dofs)
2738 "This function can not be used with distributed triangulations. "
2739 "See the documentation for more information."));
2745 support_points = internal::map_dofs_to_support_points_vector(
2746 mapping_collection, dof_handler, mask, map_locally_relevant_dofs);
2750 template <
int dim,
int spacedim>
2757 const bool map_locally_relevant_dofs)
2764 "This function can not be used with distributed triangulations. "
2765 "See the documentation for more information."));
2769 support_points = internal::map_dofs_to_support_points_vector(
2770 mapping, dof_handler, mask, map_locally_relevant_dofs);
2775 template <
int dim,
int spacedim>
2782 const bool map_locally_relevant_dofs)
2784 support_points.clear();
2790 support_points = internal::map_dofs_to_support_points(
2791 mapping_collection, dof_handler, mask, map_locally_relevant_dofs);
2796 template <
int dim,
int spacedim>
2803 const bool map_locally_relevant_dofs)
2805 support_points.clear();
2809 support_points = internal::map_dofs_to_support_points(
2810 mapping, dof_handler, mask, map_locally_relevant_dofs);
2814 template <
int dim,
int spacedim>
2815 std::map<types::global_dof_index, Point<spacedim>>
2819 const bool map_locally_relevant_dofs)
2825 return internal::map_dofs_to_support_points(mapping_collection,
2828 map_locally_relevant_dofs);
2832 template <
int dim,
int spacedim>
2833 std::map<types::global_dof_index, Point<spacedim>>
2838 const bool map_locally_relevant_dofs)
2840 return internal::map_dofs_to_support_points(
mapping,
2843 map_locally_relevant_dofs);
2847 template <
int spacedim>
2855 std::map<Point<spacedim>,
2856 std::vector<types::global_dof_index>,
2861 for (
const auto &it : support_points)
2863 std::vector<types::global_dof_index> &v = point_map[it.second];
2864 v.push_back(it.first);
2868 for (
const auto &it : point_map)
2870 out << it.first <<
" \"";
2871 const std::vector<types::global_dof_index> &v = it.second;
2872 for (
unsigned int i = 0; i < v.size(); ++i)
2886 template <
int dim,
int spacedim>
2895 const unsigned int nb = fe.
n_blocks();
2897 tables_by_block.resize(1);
2898 tables_by_block[0].reinit(nb, nb);
2899 tables_by_block[0].fill(
none);
2907 tables_by_block[0](ib, jb) |= table(i, j);
2915 tables_by_block.resize(fe_collection.
size());
2917 for (
unsigned int f = 0; f < fe_collection.
size(); ++f)
2921 const unsigned int nb = fe.
n_blocks();
2922 tables_by_block[f].reinit(nb, nb);
2923 tables_by_block[f].fill(
none);
2930 tables_by_block[f](ib, jb) |= table(i, j);
2939 template <
int dim,
int spacedim>
2943 const unsigned int level,
2944 const std::vector<bool> &selected_dofs,
2947 std::vector<types::global_dof_index> indices;
2952 if (cell->is_locally_owned_on_level())
2959 if (cell->is_locally_owned_on_level())
2961 indices.resize(cell->get_fe().n_dofs_per_cell());
2962 cell->get_mg_dof_indices(indices);
2964 if (selected_dofs.size() != 0)
2969 if (selected_dofs.empty())
2970 block_list.
add(i, indices[j] - offset);
2973 if (selected_dofs[j])
2974 block_list.
add(i, indices[j] - offset);
2982 template <
int dim,
int spacedim>
2986 const unsigned int level,
2987 const bool interior_only)
2992 std::vector<types::global_dof_index> indices;
2993 std::vector<bool> exclude;
2997 indices.resize(cell->get_fe().n_dofs_per_cell());
2998 cell->get_mg_dof_indices(indices);
3004 std::fill(exclude.begin(), exclude.end(),
false);
3006 for (
const unsigned int face : cell->face_indices())
3007 if (cell->at_boundary(face) ||
3008 cell->neighbor(face)->level() != cell->level())
3013 block_list.
add(0, indices[j]);
3017 for (
const auto index : indices)
3018 block_list.
add(0, index);
3024 template <
int dim,
int spacedim>
3028 const unsigned int level,
3029 const bool interior_dofs_only,
3030 const bool boundary_dofs)
3035 std::vector<types::global_dof_index> indices;
3036 std::vector<bool> exclude;
3038 unsigned int block = 0;
3041 if (pcell->is_active())
3044 for (
unsigned int child = 0; child < pcell->n_children(); ++child)
3046 const auto cell = pcell->child(child);
3051 indices.resize(n_dofs);
3052 exclude.resize(n_dofs);
3053 std::fill(exclude.begin(), exclude.end(),
false);
3054 cell->get_mg_dof_indices(indices);
3056 if (interior_dofs_only)
3060 for (
unsigned int d = 0; d < dim; ++d)
3062 const unsigned int face =
3071 for (
const unsigned int face :
3073 if (cell->at_boundary(face))
3079 for (
unsigned int i = 0; i < n_dofs; ++i)
3081 block_list.
add(block, indices[i]);
3087 template <
int dim,
int spacedim>
3088 std::vector<unsigned int>
3091 const unsigned int level,
3092 const bool interior_only,
3093 const bool boundary_patches,
3094 const bool level_boundary_patches,
3095 const bool single_cell_patches,
3096 const bool invert_vertex_mapping)
3103 exclude_boundary_dofs,
3105 level_boundary_patches,
3106 single_cell_patches,
3107 invert_vertex_mapping);
3110 template <
int dim,
int spacedim>
3111 std::vector<unsigned int>
3114 const unsigned int level,
3116 const bool boundary_patches,
3117 const bool level_boundary_patches,
3118 const bool single_cell_patches,
3119 const bool invert_vertex_mapping)
3123 std::vector<unsigned int> vertex_cell_count(
3127 std::vector<bool> vertex_boundary(
3130 std::vector<unsigned int> vertex_mapping(
3135 std::vector<unsigned int> vertex_dof_count(
3141 for (
const unsigned int v : cell->vertex_indices())
3143 const unsigned int vg = cell->vertex_index(v);
3144 vertex_dof_count[vg] += cell->get_fe().n_dofs_per_cell();
3145 ++vertex_cell_count[vg];
3146 for (
unsigned int d = 0; d < dim; ++d)
3149 if (cell->at_boundary(face))
3150 vertex_boundary[vg] =
true;
3151 else if ((!level_boundary_patches) &&
3152 (cell->neighbor(face)->level() !=
3153 static_cast<int>(level)))
3154 vertex_boundary[vg] =
true;
3160 for (
unsigned int vg = 0; vg < vertex_dof_count.size(); ++vg)
3161 if ((!single_cell_patches && vertex_cell_count[vg] < 2) ||
3162 (!boundary_patches && vertex_boundary[vg]))
3163 vertex_dof_count[vg] = 0;
3166 unsigned int n_vertex_count = 0;
3167 for (
unsigned int vg = 0; vg < vertex_mapping.size(); ++vg)
3168 if (vertex_dof_count[vg] != 0)
3169 vertex_mapping[vg] = n_vertex_count++;
3172 for (
unsigned int vg = 0; vg < vertex_mapping.size(); ++vg)
3173 if (vertex_dof_count[vg] != 0)
3174 vertex_dof_count[vertex_mapping[vg]] = vertex_dof_count[vg];
3178 vertex_dof_count.resize(n_vertex_count);
3182 block_list.
reinit(vertex_dof_count.size(),
3183 dof_handler.
n_dofs(level),
3186 std::vector<types::global_dof_index> indices;
3187 std::vector<bool> exclude;
3193 cell->get_mg_dof_indices(indices);
3195 for (
const unsigned int v : cell->vertex_indices())
3197 const unsigned int vg = cell->vertex_index(v);
3198 const unsigned int block = vertex_mapping[vg];
3204 if (exclude_boundary_dofs.
size() == 0 ||
3210 std::fill(exclude.begin(), exclude.end(),
false);
3212 for (
unsigned int d = 0; d < dim; ++d)
3214 const unsigned int a_face =
3216 const unsigned int face =
3229 for (
unsigned int j = 0; j < indices.size(); ++j)
3231 block_list.
add(block, indices[j]);
3235 for (
const auto index : indices)
3236 block_list.
add(block, index);
3241 if (invert_vertex_mapping)
3244 unsigned int n_vertex_count = 0;
3245 for (
unsigned int vg = 0; vg < vertex_mapping.size(); ++vg)
3247 vertex_mapping[n_vertex_count++] = vg;
3250 vertex_mapping.resize(n_vertex_count);
3253 return vertex_mapping;
3257 template <
int dim,
int spacedim>
3263 std::set<types::global_dof_index> dofs_on_patch;
3264 std::vector<types::global_dof_index> local_dof_indices;
3269 for (
unsigned int i = 0; i < patch.size(); ++i)
3273 Assert(cell->is_artificial() ==
false,
3274 ExcMessage(
"This function can not be called with cells that are "
3275 "not either locally owned or ghost cells."));
3277 cell->get_dof_indices(local_dof_indices);
3278 dofs_on_patch.insert(local_dof_indices.begin(),
3279 local_dof_indices.end());
3283 return dofs_on_patch.size();
3288 template <
int dim,
int spacedim>
3289 std::vector<types::global_dof_index>
3294 std::set<types::global_dof_index> dofs_on_patch;
3295 std::vector<types::global_dof_index> local_dof_indices;
3300 for (
unsigned int i = 0; i < patch.size(); ++i)
3304 Assert(cell->is_artificial() ==
false,
3305 ExcMessage(
"This function can not be called with cells that are "
3306 "not either locally owned or ghost cells."));
3308 cell->get_dof_indices(local_dof_indices);
3309 dofs_on_patch.insert(local_dof_indices.begin(),
3310 local_dof_indices.end());
3320 return std::vector<types::global_dof_index>(dofs_on_patch.begin(),
3321 dofs_on_patch.end());
3331#include "dofs/dof_tools.inst"
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
std::vector< types::fe_index > get_active_fe_indices() const
bool has_hp_capabilities() const
types::global_dof_index n_dofs() const
MPI_Comm get_mpi_communicator() const
MPI_Comm get_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
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
Function(const unsigned int n_components=1, const time_type initial_time=0.0)
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_DEPRECATED
#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 & ExcFENotPrimitive()
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)
static ::ExceptionBase & ExcFEHasNoSupportPoints()
#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
TriaIterator< TriaAccessor< dim - 1, dim, spacedim > > face_iterator
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
const bool IsBlockVector< VectorType >::value
@ update_quadrature_points
Transformed quadrature points.
MappingQ< dim, spacedim > StaticMappingQ1< dim, spacedim >::mapping
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)
const MPI_Datatype mpi_type_id_for_type
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 int subdomain_id
unsigned short int fe_index
unsigned int global_dof_index
* const unsigned int dofs_per_cell
static constexpr ndarray< unsigned int, vertices_per_cell, dim > vertex_to_face
static std_cxx20::ranges::iota_view< unsigned int, unsigned int > face_indices()
static constexpr std::array< unsigned int, faces_per_cell > opposite_face