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;
93 (subdomain_id == cell->subdomain_id())) &&
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(
178 (subdomain_id == cell->subdomain_id())) &&
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,
195 bool_dof_mask[fe_index]);
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 =
323 cell_row->get_fe().n_dofs_per_cell();
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;
565 (subdomain_id == cell->subdomain_id())) &&
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(
796 for (
const unsigned int f :
GeometryInfo<dim>::face_indices())
797 support_on_face(i, f) = fe.has_support_on_face(i, f);
803 bool_int_dof_mask.fill(
false);
806 if (int_dof_mask(i, j) !=
none)
807 bool_int_dof_mask(i, j) =
true;
809 for (
const auto &cell : dof.active_cell_iterators())
810 if (((subdomain_id ==
numbers::invalid_subdomain_id) ||
811 (subdomain_id == cell->subdomain_id())) &&
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();
856 spacedim>::level_cell_iterator
858 cell->neighbor_or_periodic_neighbor(face_n);
863 if (neighbor->level() == cell->level() &&
864 neighbor->index() > cell->index() &&
865 neighbor->is_active() &&
866 neighbor->is_locally_owned())
880 if (neighbor->level() != cell->level() &&
881 ((!periodic_neighbor &&
882 !cell->neighbor_is_coarser(face_n)) ||
883 (periodic_neighbor &&
884 !cell->periodic_neighbor_is_coarser(face_n))) &&
885 neighbor->is_locally_owned())
888 if (!face_has_flux_coupling(cell, face_n))
892 const unsigned int neighbor_face_n =
894 cell->periodic_neighbor_face_no(face_n) :
895 cell->neighbor_face_no(face_n);
905 while (neighbor->has_children())
906 neighbor = neighbor->child(face_n == 0 ? 1 : 0);
908 if (neighbor->has_children())
910 for (
unsigned int sub_nr = 0;
911 sub_nr != cell_face->n_children();
915 level_cell_iterator sub_neighbor =
918 ->periodic_neighbor_child_on_subface(
920 cell->neighbor_child_on_subface(face_n,
923 sub_neighbor->get_dof_indices(
925 for (
unsigned int i = 0;
929 const bool i_non_zero_i =
930 support_on_face(i, face_n);
931 const bool i_non_zero_e =
932 support_on_face(i, neighbor_face_n);
933 for (
unsigned int j = 0;
937 const bool j_non_zero_i =
938 support_on_face(j, face_n);
939 const bool j_non_zero_e =
940 support_on_face(j, neighbor_face_n);
942 if (flux_dof_mask(i, j) ==
always)
944 cell_entries.emplace_back(
945 dofs_on_this_cell[i],
946 dofs_on_other_cell[j]);
947 cell_entries.emplace_back(
948 dofs_on_other_cell[i],
949 dofs_on_this_cell[j]);
950 cell_entries.emplace_back(
951 dofs_on_this_cell[i],
952 dofs_on_this_cell[j]);
953 cell_entries.emplace_back(
954 dofs_on_other_cell[i],
955 dofs_on_other_cell[j]);
957 else if (flux_dof_mask(i, j) ==
960 if (i_non_zero_i && j_non_zero_e)
961 cell_entries.emplace_back(
962 dofs_on_this_cell[i],
963 dofs_on_other_cell[j]);
964 if (i_non_zero_e && j_non_zero_i)
965 cell_entries.emplace_back(
966 dofs_on_other_cell[i],
967 dofs_on_this_cell[j]);
968 if (i_non_zero_i && j_non_zero_i)
969 cell_entries.emplace_back(
970 dofs_on_this_cell[i],
971 dofs_on_this_cell[j]);
972 if (i_non_zero_e && j_non_zero_e)
973 cell_entries.emplace_back(
974 dofs_on_other_cell[i],
975 dofs_on_other_cell[j]);
978 if (flux_dof_mask(j, i) ==
always)
980 cell_entries.emplace_back(
981 dofs_on_this_cell[j],
982 dofs_on_other_cell[i]);
983 cell_entries.emplace_back(
984 dofs_on_other_cell[j],
985 dofs_on_this_cell[i]);
986 cell_entries.emplace_back(
987 dofs_on_this_cell[j],
988 dofs_on_this_cell[i]);
989 cell_entries.emplace_back(
990 dofs_on_other_cell[j],
991 dofs_on_other_cell[i]);
993 else if (flux_dof_mask(j, i) ==
996 if (j_non_zero_i && i_non_zero_e)
997 cell_entries.emplace_back(
998 dofs_on_this_cell[j],
999 dofs_on_other_cell[i]);
1000 if (j_non_zero_e && i_non_zero_i)
1001 cell_entries.emplace_back(
1002 dofs_on_other_cell[j],
1003 dofs_on_this_cell[i]);
1004 if (j_non_zero_i && i_non_zero_i)
1005 cell_entries.emplace_back(
1006 dofs_on_this_cell[j],
1007 dofs_on_this_cell[i]);
1008 if (j_non_zero_e && i_non_zero_e)
1009 cell_entries.emplace_back(
1010 dofs_on_other_cell[j],
1011 dofs_on_other_cell[i]);
1018 cell_entries.clear();
1022 neighbor->get_dof_indices(dofs_on_other_cell);
1026 const bool i_non_zero_i =
1027 support_on_face(i, face_n);
1028 const bool i_non_zero_e =
1029 support_on_face(i, neighbor_face_n);
1030 for (
unsigned int j = 0;
1034 const bool j_non_zero_i =
1035 support_on_face(j, face_n);
1036 const bool j_non_zero_e =
1037 support_on_face(j, neighbor_face_n);
1038 if (flux_dof_mask(i, j) ==
always)
1040 cell_entries.emplace_back(
1041 dofs_on_this_cell[i],
1042 dofs_on_other_cell[j]);
1043 cell_entries.emplace_back(
1044 dofs_on_other_cell[i],
1045 dofs_on_this_cell[j]);
1046 cell_entries.emplace_back(
1047 dofs_on_this_cell[i],
1048 dofs_on_this_cell[j]);
1049 cell_entries.emplace_back(
1050 dofs_on_other_cell[i],
1051 dofs_on_other_cell[j]);
1053 if (flux_dof_mask(i, j) ==
nonzero)
1055 if (i_non_zero_i && j_non_zero_e)
1056 cell_entries.emplace_back(
1057 dofs_on_this_cell[i],
1058 dofs_on_other_cell[j]);
1059 if (i_non_zero_e && j_non_zero_i)
1060 cell_entries.emplace_back(
1061 dofs_on_other_cell[i],
1062 dofs_on_this_cell[j]);
1063 if (i_non_zero_i && j_non_zero_i)
1064 cell_entries.emplace_back(
1065 dofs_on_this_cell[i],
1066 dofs_on_this_cell[j]);
1067 if (i_non_zero_e && j_non_zero_e)
1068 cell_entries.emplace_back(
1069 dofs_on_other_cell[i],
1070 dofs_on_other_cell[j]);
1073 if (flux_dof_mask(j, i) ==
always)
1075 cell_entries.emplace_back(
1076 dofs_on_this_cell[j],
1077 dofs_on_other_cell[i]);
1078 cell_entries.emplace_back(
1079 dofs_on_other_cell[j],
1080 dofs_on_this_cell[i]);
1081 cell_entries.emplace_back(
1082 dofs_on_this_cell[j],
1083 dofs_on_this_cell[i]);
1084 cell_entries.emplace_back(
1085 dofs_on_other_cell[j],
1086 dofs_on_other_cell[i]);
1088 if (flux_dof_mask(j, i) ==
nonzero)
1090 if (j_non_zero_i && i_non_zero_e)
1091 cell_entries.emplace_back(
1092 dofs_on_this_cell[j],
1093 dofs_on_other_cell[i]);
1094 if (j_non_zero_e && i_non_zero_i)
1095 cell_entries.emplace_back(
1096 dofs_on_other_cell[j],
1097 dofs_on_this_cell[i]);
1098 if (j_non_zero_i && i_non_zero_i)
1099 cell_entries.emplace_back(
1100 dofs_on_this_cell[j],
1101 dofs_on_this_cell[i]);
1102 if (j_non_zero_e && i_non_zero_e)
1103 cell_entries.emplace_back(
1104 dofs_on_other_cell[j],
1105 dofs_on_other_cell[i]);
1111 cell_entries.clear();
1126 const ::hp::FECollection<dim, spacedim> &fe =
1129 std::vector<types::global_dof_index> dofs_on_this_cell(
1131 std::vector<types::global_dof_index> dofs_on_other_cell(
1134 const unsigned int n_components = fe.n_components();
1144 for (
unsigned int c1 = 0; c1 < n_components; ++c1)
1145 for (
unsigned int c2 = 0; c2 < n_components; ++c2)
1146 if (int_mask(c1, c2) !=
none || flux_mask(c1, c2) !=
none)
1147 int_and_flux_mask(c1, c2) =
always;
1149 std::vector<Table<2, Coupling>> int_and_flux_dof_mask =
1154 std::vector<Table<2, bool>> bool_int_and_flux_dof_mask(fe.size());
1155 for (
unsigned int f = 0; f < fe.size(); ++f)
1157 bool_int_and_flux_dof_mask[f].reinit(
1159 fe[f].n_dofs_per_cell()));
1160 bool_int_and_flux_dof_mask[f].fill(
false);
1161 for (
unsigned int i = 0; i < fe[f].n_dofs_per_cell(); ++i)
1162 for (
unsigned int j = 0; j < fe[f].n_dofs_per_cell(); ++j)
1163 if (int_and_flux_dof_mask[f](i, j) !=
none)
1164 bool_int_and_flux_dof_mask[f](i, j) =
true;
1168 for (
const auto &cell : dof.active_cell_iterators())
1171 cell->is_locally_owned())
1173 dofs_on_this_cell.resize(cell->get_fe().n_dofs_per_cell());
1174 cell->get_dof_indices(dofs_on_this_cell);
1182 keep_constrained_dofs,
1183 bool_int_and_flux_dof_mask[cell->active_fe_index()]);
1186 for (
const unsigned int face : cell->face_indices())
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)
1197 spacedim>::level_cell_iterator
1199 cell->neighbor_or_periodic_neighbor(face);
1205 if (neighbor->level() == cell->level() &&
1206 neighbor->index() > cell->index() &&
1207 neighbor->is_active() &&
1208 neighbor->is_locally_owned())
1222 if (neighbor->level() != cell->level() &&
1223 ((!periodic_neighbor &&
1224 !cell->neighbor_is_coarser(face)) ||
1225 (periodic_neighbor &&
1226 !cell->periodic_neighbor_is_coarser(face))) &&
1227 neighbor->is_locally_owned())
1231 if (!face_has_flux_coupling(cell, face))
1241 while (neighbor->has_children())
1242 neighbor = neighbor->child(face == 0 ? 1 : 0);
1244 if (neighbor->has_children())
1246 for (
unsigned int sub_nr = 0;
1247 sub_nr != cell_face->n_children();
1251 level_cell_iterator sub_neighbor =
1254 ->periodic_neighbor_child_on_subface(
1256 cell->neighbor_child_on_subface(face,
1259 dofs_on_other_cell.resize(
1261 sub_neighbor->get_dof_indices(
1262 dofs_on_other_cell);
1263 for (
unsigned int i = 0;
1264 i < cell->get_fe().n_dofs_per_cell();
1267 const unsigned int ii =
1268 (cell->get_fe().is_primitive(i) ?
1270 .system_to_component_index(i)
1273 .get_nonzero_components(i)
1274 .first_selected_component());
1276 Assert(ii < cell->get_fe().n_components(),
1279 for (
unsigned int j = 0;
1280 j < sub_neighbor->
get_fe()
1284 const unsigned int jj =
1294 Assert(jj < sub_neighbor->get_fe()
1298 if ((flux_mask(ii, jj) ==
always) ||
1299 (flux_mask(ii, jj) ==
nonzero))
1301 cell_entries.emplace_back(
1302 dofs_on_this_cell[i],
1303 dofs_on_other_cell[j]);
1306 if ((flux_mask(jj, ii) ==
always) ||
1307 (flux_mask(jj, ii) ==
nonzero))
1309 cell_entries.emplace_back(
1310 dofs_on_other_cell[j],
1311 dofs_on_this_cell[i]);
1319 dofs_on_other_cell.resize(
1320 neighbor->get_fe().n_dofs_per_cell());
1321 neighbor->get_dof_indices(dofs_on_other_cell);
1322 for (
unsigned int i = 0;
1323 i < cell->get_fe().n_dofs_per_cell();
1326 const unsigned int ii =
1327 (cell->get_fe().is_primitive(i) ?
1329 .system_to_component_index(i)
1332 .get_nonzero_components(i)
1333 .first_selected_component());
1335 Assert(ii < cell->get_fe().n_components(),
1338 for (
unsigned int j = 0;
1339 j < neighbor->get_fe().n_dofs_per_cell();
1342 const unsigned int jj =
1343 (neighbor->get_fe().is_primitive(j) ?
1345 .system_to_component_index(j)
1348 .get_nonzero_components(j)
1349 .first_selected_component());
1352 jj < neighbor->get_fe().n_components(),
1355 if ((flux_mask(ii, jj) ==
always) ||
1356 (flux_mask(ii, jj) ==
nonzero))
1358 cell_entries.emplace_back(
1359 dofs_on_this_cell[i],
1360 dofs_on_other_cell[j]);
1363 if ((flux_mask(jj, ii) ==
always) ||
1364 (flux_mask(jj, ii) ==
nonzero))
1366 cell_entries.emplace_back(
1367 dofs_on_other_cell[j],
1368 dofs_on_this_cell[i]);
1376 cell_entries.clear();
1386 template <
int dim,
int spacedim>
1396 const bool keep_constrained_dofs =
true;
1401 keep_constrained_dofs,
1405 internal::always_couple_on_faces<dim, spacedim>);
1410 template <
int dim,
int spacedim,
typename number>
1416 const bool keep_constrained_dofs,
1420 const std::function<
1422 const unsigned int)> &face_has_flux_coupling)
1435 Assert(int_mask.n_rows() == n_comp,
1437 Assert(int_mask.n_cols() == n_comp,
1439 Assert(flux_mask.n_rows() == n_comp,
1441 Assert(flux_mask.n_cols() == n_comp,
1454 "For distributed Triangulation objects and associated "
1455 "DoFHandler objects, asking for any subdomain other than the "
1456 "locally owned one does not make sense."));
1460 face_has_flux_coupling,
1462 "The function which specifies if a flux coupling occurs over a given "
1465 internal::make_flux_sparsity_pattern(dof,
1468 keep_constrained_dofs,
1472 face_has_flux_coupling);
1480#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
const hp::FECollection< dim, spacedim > & get_fe_collection() const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) 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
typename LevelSelector::cell_iterator level_cell_iterator
cell_iterator begin(const unsigned int level=0) const
unsigned int n_dofs_per_vertex() const
unsigned int n_dofs_per_cell() const
unsigned int n_components() const
const ComponentMask & get_nonzero_components(const unsigned int i) const
bool is_primitive() const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int 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
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
typename ActiveSelector::cell_iterator cell_iterator
typename ActiveSelector::face_iterator face_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
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 subdomain_id
unsigned short int fe_index
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation