54 template <
int dim,
int spacedim,
typename number>
59 const bool keep_constrained_dofs,
80 "For distributed Triangulation objects and associated "
81 "DoFHandler objects, asking for any subdomain other than the "
82 "locally owned one does not make sense."));
85 std::vector<types::global_dof_index> dofs_on_this_cell;
94 cell->is_locally_owned())
96 const unsigned int dofs_per_cell = cell->get_fe().n_dofs_per_cell();
97 dofs_on_this_cell.resize(dofs_per_cell);
98 cell->get_dof_indices(dofs_on_this_cell);
105 keep_constrained_dofs);
111 template <
int dim,
int spacedim,
typename number>
117 const bool keep_constrained_dofs,
144 "For distributed Triangulation objects and associated "
145 "DoFHandler objects, asking for any subdomain other than the "
146 "locally owned one does not make sense."));
152 const std::vector<Table<2, Coupling>> dof_mask
157 std::vector<Table<2, bool>> bool_dof_mask(fe_collection.
size());
158 for (
unsigned int f = 0; f < fe_collection.
size(); ++f)
160 bool_dof_mask[f].reinit(
162 fe_collection[f].n_dofs_per_cell()));
163 bool_dof_mask[f].fill(
false);
164 for (
unsigned int i = 0; i < fe_collection[f].n_dofs_per_cell(); ++i)
165 for (
unsigned int j = 0; j < fe_collection[f].n_dofs_per_cell(); ++j)
166 if (dof_mask[f](i, j) !=
none)
167 bool_dof_mask[f](i, j) =
true;
170 std::vector<types::global_dof_index> dofs_on_this_cell(
179 cell->is_locally_owned())
182 const unsigned int dofs_per_cell =
183 fe_collection[
fe_index].n_dofs_per_cell();
185 dofs_on_this_cell.resize(dofs_per_cell);
186 cell->get_dof_indices(dofs_on_this_cell);
194 keep_constrained_dofs,
201 template <
int dim,
int spacedim>
228 ExcMessage(
"This function can only be used with with parallel "
229 "Triangulations when the Triangulations are equal."));
235 std::list<std::pair<cell_iterator, cell_iterator>> cell_list =
238 #ifdef DEAL_II_WITH_MPI
249 Assert(this_subdomain_id ==
256 [=](
const std::pair<cell_iterator, cell_iterator> &pair) {
257 return pair.first->subdomain_id() != this_subdomain_id ||
258 pair.second->subdomain_id() != this_subdomain_id;
264 for (
const auto &cell_pair : cell_list)
266 const cell_iterator cell_row = cell_pair.first;
267 const cell_iterator cell_col = cell_pair.second;
269 if (cell_row->is_active() && cell_col->is_active())
271 const unsigned int dofs_per_cell_row =
272 cell_row->get_fe().n_dofs_per_cell();
273 const unsigned int dofs_per_cell_col =
274 cell_col->get_fe().n_dofs_per_cell();
275 std::vector<types::global_dof_index> local_dof_indices_row(
277 std::vector<types::global_dof_index> local_dof_indices_col(
279 cell_row->get_dof_indices(local_dof_indices_row);
280 cell_col->get_dof_indices(local_dof_indices_col);
281 for (
const auto &dof : local_dof_indices_row)
285 else if (cell_row->has_children())
290 GridTools::get_active_child_cells<DoFHandler<dim, spacedim>>(
292 for (
unsigned int i = 0; i < child_cells.size(); ++i)
295 cell_row_child = child_cells[i];
296 const unsigned int dofs_per_cell_row =
298 const unsigned int dofs_per_cell_col =
299 cell_col->get_fe().n_dofs_per_cell();
300 std::vector<types::global_dof_index> local_dof_indices_row(
302 std::vector<types::global_dof_index> local_dof_indices_col(
304 cell_row_child->get_dof_indices(local_dof_indices_row);
305 cell_col->get_dof_indices(local_dof_indices_col);
306 for (
const auto &dof : local_dof_indices_row)
316 GridTools::get_active_child_cells<DoFHandler<dim, spacedim>>(
318 for (
unsigned int i = 0; i < child_cells.size(); ++i)
321 cell_col_child = child_cells[i];
322 const unsigned int dofs_per_cell_row =
324 const unsigned int dofs_per_cell_col =
326 std::vector<types::global_dof_index> local_dof_indices_row(
328 std::vector<types::global_dof_index> local_dof_indices_col(
330 cell_row->get_dof_indices(local_dof_indices_row);
331 cell_col_child->get_dof_indices(local_dof_indices_col);
332 for (
const auto &dof : local_dof_indices_row)
342 template <
int dim,
int spacedim>
346 const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
353 std::map<types::boundary_id, const Function<spacedim, double> *>
355 boundary_ids[0] =
nullptr;
356 boundary_ids[1] =
nullptr;
357 make_boundary_sparsity_pattern<dim, spacedim>(dof,
359 dof_to_boundary_mapping,
371 if (sparsity.
n_rows() != 0)
381 std::vector<types::global_dof_index> dofs_on_this_face;
383 std::vector<types::global_dof_index> cols;
391 for (
const unsigned int f : cell->face_indices())
392 if (cell->at_boundary(f))
394 const unsigned int dofs_per_face =
395 cell->get_fe().n_dofs_per_face(f);
396 dofs_on_this_face.resize(dofs_per_face);
397 cell->face(f)->get_dof_indices(dofs_on_this_face,
398 cell->active_fe_index());
402 for (
const auto &dof : dofs_on_this_face)
403 cols.push_back(dof_to_boundary_mapping[dof]);
407 std::sort(cols.begin(), cols.end());
408 for (
const auto &dof : dofs_on_this_face)
417 template <
int dim,
int spacedim,
typename number>
423 const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
429 for (
unsigned int direction = 0; direction < 2; ++direction)
432 if (boundary_ids.find(direction) == boundary_ids.end())
439 while (!cell->at_boundary(direction))
440 cell = cell->neighbor(direction);
441 while (!cell->is_active())
442 cell = cell->child(direction);
444 const unsigned int dofs_per_vertex =
446 std::vector<types::global_dof_index> boundary_dof_boundary_indices(
450 for (
unsigned int i = 0; i < dofs_per_vertex; ++i)
451 boundary_dof_boundary_indices[i] =
452 dof_to_boundary_mapping[cell->vertex_dof_index(direction, i)];
454 std::sort(boundary_dof_boundary_indices.begin(),
455 boundary_dof_boundary_indices.end());
456 for (
const auto &dof : boundary_dof_boundary_indices)
477 if (sparsity.
n_rows() != 0)
487 std::vector<types::global_dof_index> dofs_on_this_face;
489 std::vector<types::global_dof_index> cols;
492 for (
const unsigned int f : cell->face_indices())
493 if (boundary_ids.find(cell->face(f)->boundary_id()) !=
496 const unsigned int dofs_per_face =
497 cell->get_fe().n_dofs_per_face(f);
498 dofs_on_this_face.resize(dofs_per_face);
499 cell->face(f)->get_dof_indices(dofs_on_this_face,
500 cell->active_fe_index());
504 for (
const auto &dof : dofs_on_this_face)
505 cols.push_back(dof_to_boundary_mapping[dof]);
508 std::sort(cols.begin(), cols.end());
509 for (
const auto &dof : dofs_on_this_face)
518 template <
int dim,
int spacedim,
typename number>
523 const bool keep_constrained_dofs,
545 "For distributed Triangulation objects and associated "
546 "DoFHandler objects, asking for any subdomain other than the "
547 "locally owned one does not make sense."));
550 std::vector<types::global_dof_index> dofs_on_this_cell;
551 std::vector<types::global_dof_index> dofs_on_other_cell;
566 cell->is_locally_owned())
568 const unsigned int n_dofs_on_this_cell =
569 cell->get_fe().n_dofs_per_cell();
570 dofs_on_this_cell.resize(n_dofs_on_this_cell);
571 cell->get_dof_indices(dofs_on_this_cell);
578 keep_constrained_dofs);
580 for (
const unsigned int face : cell->face_indices())
584 const bool periodic_neighbor = cell->has_periodic_neighbor(face);
585 if (!cell->at_boundary(face) || periodic_neighbor)
588 neighbor = cell->neighbor_or_periodic_neighbor(face);
595 while (neighbor->has_children())
596 neighbor = neighbor->child(face == 0 ? 1 : 0);
598 if (neighbor->has_children())
600 for (
unsigned int sub_nr = 0;
601 sub_nr != cell_face->n_active_descendants();
605 level_cell_iterator sub_neighbor =
607 cell->periodic_neighbor_child_on_subface(
609 cell->neighbor_child_on_subface(face, sub_nr);
611 const unsigned int n_dofs_on_neighbor =
613 dofs_on_other_cell.resize(n_dofs_on_neighbor);
614 sub_neighbor->get_dof_indices(dofs_on_other_cell);
620 keep_constrained_dofs);
625 keep_constrained_dofs);
629 if (sub_neighbor->subdomain_id() !=
630 cell->subdomain_id())
634 keep_constrained_dofs);
641 if ((!periodic_neighbor &&
642 cell->neighbor_is_coarser(face)) ||
643 (periodic_neighbor &&
644 cell->periodic_neighbor_is_coarser(face)))
645 if (neighbor->subdomain_id() == cell->subdomain_id())
648 const unsigned int n_dofs_on_neighbor =
650 dofs_on_other_cell.resize(n_dofs_on_neighbor);
652 neighbor->get_dof_indices(dofs_on_other_cell);
658 keep_constrained_dofs);
664 if (!cell->neighbor_or_periodic_neighbor(face)
666 (neighbor->subdomain_id() != cell->subdomain_id()))
672 keep_constrained_dofs);
673 if (neighbor->subdomain_id() != cell->subdomain_id())
677 keep_constrained_dofs);
687 template <
int dim,
int spacedim>
696 template <
int dim,
int spacedim>
713 for (
unsigned int i = 0; i < n_dofs; ++i)
715 const unsigned int ii =
721 for (
unsigned int j = 0; j < n_dofs; ++j)
723 const unsigned int jj =
729 dof_couplings(i, j) = component_couplings(ii, jj);
732 return dof_couplings;
737 template <
int dim,
int spacedim>
738 std::vector<Table<2, Coupling>>
743 std::vector<Table<2, Coupling>> return_value(fe.
size());
744 for (
unsigned int i = 0; i < fe.
size(); ++i)
759 template <
int dim,
int spacedim,
typename number>
765 const bool keep_constrained_dofs,
771 const unsigned int)> &face_has_flux_coupling)
773 std::vector<types::global_dof_index> rows;
782 std::vector<types::global_dof_index> dofs_on_this_cell(
784 std::vector<types::global_dof_index> dofs_on_other_cell(
803 bool_int_dof_mask.fill(
false);
806 if (int_dof_mask(i, j) != none)
807 bool_int_dof_mask(i, j) =
true;
812 cell->is_locally_owned())
814 cell->get_dof_indices(dofs_on_this_cell);
818 keep_constrained_dofs,
821 for (
const unsigned int face_n : cell->face_indices())
824 cell_face = cell->face(face_n);
826 const bool periodic_neighbor =
827 cell->has_periodic_neighbor(face_n);
829 if (cell->at_boundary(face_n) && (!periodic_neighbor))
834 const bool i_non_zero_i =
835 support_on_face(i, face_n);
839 const bool j_non_zero_i =
840 support_on_face(j, face_n);
842 if (flux_dof_mask(i, j) ==
always ||
843 (flux_dof_mask(i, j) ==
nonzero &&
844 i_non_zero_i && j_non_zero_i))
845 cell_entries.emplace_back(
846 dofs_on_this_cell[i],
847 dofs_on_this_cell[j]);
851 cell_entries.clear();
855 if (!face_has_flux_coupling(cell, face_n))
859 spacedim>::level_cell_iterator
861 cell->neighbor_or_periodic_neighbor(face_n);
866 if (neighbor->level() == cell->level() &&
867 neighbor->index() > cell->index() &&
868 neighbor->is_active() &&
869 neighbor->is_locally_owned())
883 if (neighbor->level() != cell->level() &&
884 ((!periodic_neighbor &&
885 !cell->neighbor_is_coarser(face_n)) ||
886 (periodic_neighbor &&
887 !cell->periodic_neighbor_is_coarser(face_n))) &&
888 neighbor->is_locally_owned())
891 const unsigned int neighbor_face_n =
893 cell->periodic_neighbor_face_no(face_n) :
894 cell->neighbor_face_no(face_n);
904 while (neighbor->has_children())
905 neighbor = neighbor->child(face_n == 0 ? 1 : 0);
907 if (neighbor->has_children())
909 for (
unsigned int sub_nr = 0;
910 sub_nr != cell_face->n_children();
914 level_cell_iterator sub_neighbor =
917 ->periodic_neighbor_child_on_subface(
919 cell->neighbor_child_on_subface(face_n,
922 sub_neighbor->get_dof_indices(
924 for (
unsigned int i = 0;
928 const bool i_non_zero_i =
929 support_on_face(i, face_n);
930 const bool i_non_zero_e =
931 support_on_face(i, neighbor_face_n);
932 for (
unsigned int j = 0;
936 const bool j_non_zero_i =
937 support_on_face(j, face_n);
938 const bool j_non_zero_e =
939 support_on_face(j, neighbor_face_n);
941 if (flux_dof_mask(i, j) ==
always)
943 cell_entries.emplace_back(
944 dofs_on_this_cell[i],
945 dofs_on_other_cell[j]);
946 cell_entries.emplace_back(
947 dofs_on_other_cell[i],
948 dofs_on_this_cell[j]);
949 cell_entries.emplace_back(
950 dofs_on_this_cell[i],
951 dofs_on_this_cell[j]);
952 cell_entries.emplace_back(
953 dofs_on_other_cell[i],
954 dofs_on_other_cell[j]);
956 else if (flux_dof_mask(i, j) ==
959 if (i_non_zero_i && j_non_zero_e)
960 cell_entries.emplace_back(
961 dofs_on_this_cell[i],
962 dofs_on_other_cell[j]);
963 if (i_non_zero_e && j_non_zero_i)
964 cell_entries.emplace_back(
965 dofs_on_other_cell[i],
966 dofs_on_this_cell[j]);
967 if (i_non_zero_i && j_non_zero_i)
968 cell_entries.emplace_back(
969 dofs_on_this_cell[i],
970 dofs_on_this_cell[j]);
971 if (i_non_zero_e && j_non_zero_e)
972 cell_entries.emplace_back(
973 dofs_on_other_cell[i],
974 dofs_on_other_cell[j]);
977 if (flux_dof_mask(j, i) ==
always)
979 cell_entries.emplace_back(
980 dofs_on_this_cell[j],
981 dofs_on_other_cell[i]);
982 cell_entries.emplace_back(
983 dofs_on_other_cell[j],
984 dofs_on_this_cell[i]);
985 cell_entries.emplace_back(
986 dofs_on_this_cell[j],
987 dofs_on_this_cell[i]);
988 cell_entries.emplace_back(
989 dofs_on_other_cell[j],
990 dofs_on_other_cell[i]);
992 else if (flux_dof_mask(j, i) ==
995 if (j_non_zero_i && i_non_zero_e)
996 cell_entries.emplace_back(
997 dofs_on_this_cell[j],
998 dofs_on_other_cell[i]);
999 if (j_non_zero_e && i_non_zero_i)
1000 cell_entries.emplace_back(
1001 dofs_on_other_cell[j],
1002 dofs_on_this_cell[i]);
1003 if (j_non_zero_i && i_non_zero_i)
1004 cell_entries.emplace_back(
1005 dofs_on_this_cell[j],
1006 dofs_on_this_cell[i]);
1007 if (j_non_zero_e && i_non_zero_e)
1008 cell_entries.emplace_back(
1009 dofs_on_other_cell[j],
1010 dofs_on_other_cell[i]);
1017 cell_entries.clear();
1021 neighbor->get_dof_indices(dofs_on_other_cell);
1025 const bool i_non_zero_i =
1026 support_on_face(i, face_n);
1027 const bool i_non_zero_e =
1028 support_on_face(i, neighbor_face_n);
1029 for (
unsigned int j = 0;
1033 const bool j_non_zero_i =
1034 support_on_face(j, face_n);
1035 const bool j_non_zero_e =
1036 support_on_face(j, neighbor_face_n);
1037 if (flux_dof_mask(i, j) ==
always)
1039 cell_entries.emplace_back(
1040 dofs_on_this_cell[i],
1041 dofs_on_other_cell[j]);
1042 cell_entries.emplace_back(
1043 dofs_on_other_cell[i],
1044 dofs_on_this_cell[j]);
1045 cell_entries.emplace_back(
1046 dofs_on_this_cell[i],
1047 dofs_on_this_cell[j]);
1048 cell_entries.emplace_back(
1049 dofs_on_other_cell[i],
1050 dofs_on_other_cell[j]);
1052 if (flux_dof_mask(i, j) ==
nonzero)
1054 if (i_non_zero_i && j_non_zero_e)
1055 cell_entries.emplace_back(
1056 dofs_on_this_cell[i],
1057 dofs_on_other_cell[j]);
1058 if (i_non_zero_e && j_non_zero_i)
1059 cell_entries.emplace_back(
1060 dofs_on_other_cell[i],
1061 dofs_on_this_cell[j]);
1062 if (i_non_zero_i && j_non_zero_i)
1063 cell_entries.emplace_back(
1064 dofs_on_this_cell[i],
1065 dofs_on_this_cell[j]);
1066 if (i_non_zero_e && j_non_zero_e)
1067 cell_entries.emplace_back(
1068 dofs_on_other_cell[i],
1069 dofs_on_other_cell[j]);
1072 if (flux_dof_mask(j, i) ==
always)
1074 cell_entries.emplace_back(
1075 dofs_on_this_cell[j],
1076 dofs_on_other_cell[i]);
1077 cell_entries.emplace_back(
1078 dofs_on_other_cell[j],
1079 dofs_on_this_cell[i]);
1080 cell_entries.emplace_back(
1081 dofs_on_this_cell[j],
1082 dofs_on_this_cell[i]);
1083 cell_entries.emplace_back(
1084 dofs_on_other_cell[j],
1085 dofs_on_other_cell[i]);
1087 if (flux_dof_mask(j, i) ==
nonzero)
1089 if (j_non_zero_i && i_non_zero_e)
1090 cell_entries.emplace_back(
1091 dofs_on_this_cell[j],
1092 dofs_on_other_cell[i]);
1093 if (j_non_zero_e && i_non_zero_i)
1094 cell_entries.emplace_back(
1095 dofs_on_other_cell[j],
1096 dofs_on_this_cell[i]);
1097 if (j_non_zero_i && i_non_zero_i)
1098 cell_entries.emplace_back(
1099 dofs_on_this_cell[j],
1100 dofs_on_this_cell[i]);
1101 if (j_non_zero_e && i_non_zero_e)
1102 cell_entries.emplace_back(
1103 dofs_on_other_cell[j],
1104 dofs_on_other_cell[i]);
1110 cell_entries.clear();
1125 const ::hp::FECollection<dim, spacedim> &fe =
1128 std::vector<types::global_dof_index> dofs_on_this_cell(
1130 std::vector<types::global_dof_index> dofs_on_other_cell(
1133 const unsigned int n_components = fe.n_components();
1143 for (
unsigned int c1 = 0; c1 < n_components; ++c1)
1144 for (
unsigned int c2 = 0; c2 < n_components; ++c2)
1145 if (int_mask(c1, c2) != none || flux_mask(c1, c2) != none)
1146 int_and_flux_mask(c1, c2) =
always;
1148 std::vector<Table<2, Coupling>> int_and_flux_dof_mask =
1153 std::vector<Table<2, bool>> bool_int_and_flux_dof_mask(fe.size());
1154 for (
unsigned int f = 0; f < fe.size(); ++f)
1156 bool_int_and_flux_dof_mask[f].reinit(
1158 fe[f].n_dofs_per_cell()));
1159 bool_int_and_flux_dof_mask[f].fill(
false);
1160 for (
unsigned int i = 0; i < fe[f].n_dofs_per_cell(); ++i)
1161 for (
unsigned int j = 0; j < fe[f].n_dofs_per_cell(); ++j)
1162 if (int_and_flux_dof_mask[f](i, j) != none)
1163 bool_int_and_flux_dof_mask[f](i, j) =
true;
1170 cell->is_locally_owned())
1172 dofs_on_this_cell.resize(cell->get_fe().n_dofs_per_cell());
1173 cell->get_dof_indices(dofs_on_this_cell);
1181 keep_constrained_dofs,
1182 bool_int_and_flux_dof_mask[cell->active_fe_index()]);
1185 for (
const unsigned int face : cell->face_indices())
1187 const typename ::DoFHandler<dim,
1188 spacedim>::face_iterator
1189 cell_face = cell->face(face);
1191 const bool periodic_neighbor =
1192 cell->has_periodic_neighbor(face);
1194 if ((!cell->at_boundary(face)) || periodic_neighbor)
1196 typename ::DoFHandler<dim, spacedim>::
1197 level_cell_iterator neighbor =
1198 cell->neighbor_or_periodic_neighbor(face);
1200 if (!face_has_flux_coupling(cell, face))
1207 if (neighbor->level() == cell->level() &&
1208 neighbor->index() > cell->index() &&
1209 neighbor->is_active() &&
1210 neighbor->is_locally_owned())
1224 if (neighbor->level() != cell->level() &&
1225 ((!periodic_neighbor &&
1226 !cell->neighbor_is_coarser(face)) ||
1227 (periodic_neighbor &&
1228 !cell->periodic_neighbor_is_coarser(face))) &&
1229 neighbor->is_locally_owned())
1239 while (neighbor->has_children())
1240 neighbor = neighbor->child(face == 0 ? 1 : 0);
1242 if (neighbor->has_children())
1244 for (
unsigned int sub_nr = 0;
1245 sub_nr != cell_face->n_children();
1248 const typename ::DoFHandler<dim,
1250 level_cell_iterator sub_neighbor =
1253 ->periodic_neighbor_child_on_subface(
1255 cell->neighbor_child_on_subface(face,
1258 dofs_on_other_cell.resize(
1259 sub_neighbor->get_fe().n_dofs_per_cell());
1260 sub_neighbor->get_dof_indices(
1261 dofs_on_other_cell);
1262 for (
unsigned int i = 0;
1263 i < cell->get_fe().n_dofs_per_cell();
1266 const unsigned int ii =
1267 (cell->get_fe().is_primitive(i) ?
1269 .system_to_component_index(i)
1272 .get_nonzero_components(i)
1273 .first_selected_component());
1275 Assert(ii < cell->get_fe().n_components(),
1278 for (
unsigned int j = 0;
1279 j < sub_neighbor->get_fe()
1283 const unsigned int jj =
1284 (sub_neighbor->get_fe()
1286 sub_neighbor->get_fe()
1287 .system_to_component_index(j)
1289 sub_neighbor->get_fe()
1290 .get_nonzero_components(j)
1291 .first_selected_component());
1293 Assert(jj < sub_neighbor->get_fe()
1297 if ((flux_mask(ii, jj) ==
always) ||
1298 (flux_mask(ii, jj) ==
nonzero))
1300 cell_entries.emplace_back(
1301 dofs_on_this_cell[i],
1302 dofs_on_other_cell[j]);
1305 if ((flux_mask(jj, ii) ==
always) ||
1306 (flux_mask(jj, ii) ==
nonzero))
1308 cell_entries.emplace_back(
1309 dofs_on_other_cell[j],
1310 dofs_on_this_cell[i]);
1318 dofs_on_other_cell.resize(
1319 neighbor->get_fe().n_dofs_per_cell());
1320 neighbor->get_dof_indices(dofs_on_other_cell);
1321 for (
unsigned int i = 0;
1322 i < cell->get_fe().n_dofs_per_cell();
1325 const unsigned int ii =
1326 (cell->get_fe().is_primitive(i) ?
1328 .system_to_component_index(i)
1331 .get_nonzero_components(i)
1332 .first_selected_component());
1334 Assert(ii < cell->get_fe().n_components(),
1337 for (
unsigned int j = 0;
1338 j < neighbor->get_fe().n_dofs_per_cell();
1341 const unsigned int jj =
1342 (neighbor->get_fe().is_primitive(j) ?
1344 .system_to_component_index(j)
1347 .get_nonzero_components(j)
1348 .first_selected_component());
1351 jj < neighbor->get_fe().n_components(),
1354 if ((flux_mask(ii, jj) ==
always) ||
1355 (flux_mask(ii, jj) ==
nonzero))
1357 cell_entries.emplace_back(
1358 dofs_on_this_cell[i],
1359 dofs_on_other_cell[j]);
1362 if ((flux_mask(jj, ii) ==
always) ||
1363 (flux_mask(jj, ii) ==
nonzero))
1365 cell_entries.emplace_back(
1366 dofs_on_other_cell[j],
1367 dofs_on_this_cell[i]);
1375 cell_entries.clear();
1385 template <
int dim,
int spacedim>
1395 const bool keep_constrained_dofs =
true;
1400 keep_constrained_dofs,
1404 internal::always_couple_on_faces<dim, spacedim>);
1409 template <
int dim,
int spacedim,
typename number>
1415 const bool keep_constrained_dofs,
1419 const std::function<
1421 const unsigned int)> &face_has_flux_coupling)
1434 Assert(int_mask.n_rows() == n_comp,
1436 Assert(int_mask.n_cols() == n_comp,
1438 Assert(flux_mask.n_rows() == n_comp,
1440 Assert(flux_mask.n_cols() == n_comp,
1453 "For distributed Triangulation objects and associated "
1454 "DoFHandler objects, asking for any subdomain other than the "
1455 "locally owned one does not make sense."));
1459 face_has_flux_coupling,
1461 "The function which specifies if a flux coupling occurs over a given "
1467 keep_constrained_dofs,
1471 face_has_flux_coupling);
1479 #include "dof_tools_sparsity.inst"
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
void add_entries_local_to_global(const std::vector< size_type > &local_dof_indices, SparsityPatternBase &sparsity_pattern, const bool keep_constrained_entries=true, const Table< 2, bool > &dof_mask=Table< 2, bool >()) const
unsigned int first_selected_component(const unsigned int overall_number_of_components=numbers::invalid_unsigned_int) const
types::global_dof_index n_boundary_dofs() const
const Triangulation< dim, spacedim > & get_triangulation() const
bool has_hp_capabilities() const
types::global_dof_index n_dofs() const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
cell_iterator begin(const unsigned int level=0) const
const hp::FECollection< dim, spacedim > & get_fe_collection() const
unsigned int n_dofs_per_vertex() const
unsigned int n_dofs_per_cell() const
unsigned int n_components() const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
const ComponentMask & get_nonzero_components(const unsigned int i) const
bool is_primitive() const
virtual bool has_support_on_face(const unsigned int shape_index, const unsigned int face_index) const
types::global_dof_index size_type
virtual void add_entries(const ArrayView< const std::pair< size_type, size_type >> &entries)
virtual void add_row_entries(const size_type &row, const ArrayView< const size_type > &columns, const bool indices_are_sorted=false)=0
virtual types::subdomain_id locally_owned_subdomain() const
unsigned int size() const
unsigned int max_dofs_per_face() const
unsigned int max_dofs_per_cell() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
IteratorRange< active_cell_iterator > active_cell_iterators() const
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcMessage(std::string arg1)
void make_flux_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern)
void make_boundary_sparsity_pattern(const DoFHandler< dim, spacedim > &dof, const std::vector< types::global_dof_index > &dof_to_boundary_mapping, SparsityPatternBase &sparsity_pattern)
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints=AffineConstraints< number >(), const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
const types::boundary_id internal_face_boundary_id
const types::subdomain_id invalid_subdomain_id
const types::global_dof_index invalid_dof_index
unsigned int global_dof_index
unsigned int subdomain_id
unsigned short int fe_index
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation