16 #include <deal.II/base/memory_consumption.h> 17 #include <deal.II/base/geometry_info.h> 18 #include <deal.II/base/thread_management.h> 19 #include <deal.II/base/std_cxx11/bind.h> 20 #include <deal.II/hp/dof_handler.h> 21 #include <deal.II/hp/dof_level.h> 22 #include <deal.II/hp/dof_faces.h> 23 #include <deal.II/dofs/dof_accessor.h> 24 #include <deal.II/grid/tria_accessor.h> 25 #include <deal.II/grid/tria_iterator.h> 26 #include <deal.II/grid/tria_levels.h> 27 #include <deal.II/grid/tria.h> 28 #include <deal.II/fe/fe.h> 29 #include <deal.II/distributed/shared_tria.h> 30 #include <deal.II/distributed/tria.h> 36 DEAL_II_NAMESPACE_OPEN
42 #if defined(_MSC_VER) && (_MSC_VER >= 1800) 46 #define HpDoFHandler DoFHandler 63 std::vector<std::pair<unsigned int, unsigned int> > DoFIdentities;
81 template <
int structdim,
int dim,
int spacedim>
85 std_cxx11::shared_ptr<DoFIdentities> &identities)
90 if (identities.get() == 0)
97 std_cxx11::shared_ptr<DoFIdentities>
105 std_cxx11::shared_ptr<DoFIdentities>
113 std_cxx11::shared_ptr<DoFIdentities>
125 for (
unsigned int i=0; i<identities->size(); ++i)
127 Assert ((*identities)[i].first < fe1.template n_dofs_per_object<structdim>(),
129 Assert ((*identities)[i].second < fe2.template n_dofs_per_object<structdim>(),
146 template <
int dim,
int spacedim,
typename iterator>
148 get_most_dominating_fe_index (
const iterator &
object)
150 unsigned int dominating_fe_index = 0;
151 for (; dominating_fe_index<
object->n_active_fe_indices();
152 ++dominating_fe_index)
155 =
object->get_fe (object->nth_active_fe_index(dominating_fe_index));
159 for (
unsigned int other_fe_index=0;
160 other_fe_index<
object->n_active_fe_indices();
162 if (other_fe_index != dominating_fe_index)
166 =
object->get_fe (object->nth_active_fe_index(other_fe_index));
168 domination = domination &
186 if (dominating_fe_index != object->n_active_fe_indices())
192 return object->nth_active_fe_index(dominating_fe_index);
214 using ::hp::DoFHandler;
229 template<
int dim,
int spacedim>
246 std::vector<std::vector<bool> >
247 vertex_fe_association (dof_handler.finite_elements->size(),
248 std::vector<bool> (dof_handler.
tria->n_vertices(),
false));
250 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
252 for (
unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
253 vertex_fe_association[cell->active_fe_index()][cell->vertex_index(v)]
264 for (
unsigned int v=0; v<dof_handler.
tria->n_vertices(); ++v)
265 if (dof_handler.
tria->vertex_used(v) ==
true)
268 for (; fe<dof_handler.finite_elements->size(); ++fe)
269 if (vertex_fe_association[fe][v] ==
true)
286 dof_handler.vertex_dofs_offsets.resize (dof_handler.
tria->n_vertices(),
289 unsigned int vertex_slots_needed = 0;
290 for (
unsigned int v=0; v<dof_handler.
tria->n_vertices(); ++v)
291 if (dof_handler.
tria->vertex_used(v) ==
true)
293 dof_handler.vertex_dofs_offsets[v] = vertex_slots_needed;
295 for (
unsigned int fe=0; fe<dof_handler.finite_elements->size(); ++fe)
296 if (vertex_fe_association[fe][v] ==
true)
297 vertex_slots_needed += (*dof_handler.finite_elements)[fe].dofs_per_vertex + 1;
298 ++vertex_slots_needed;
305 dof_handler.
vertex_dofs.resize (vertex_slots_needed,
307 for (
unsigned int v=0; v<dof_handler.
tria->n_vertices(); ++v)
308 if (dof_handler.
tria->vertex_used(v) ==
true)
311 for (
unsigned int fe=0; fe<dof_handler.finite_elements->size(); ++fe)
312 if (vertex_fe_association[fe][v] ==
true)
321 pointer += (*dof_handler.finite_elements)[fe].dofs_per_vertex + 1;
345 template <
int spacedim>
351 const unsigned int dim = 1;
354 const unsigned int fe_index = cell->active_fe_index ();
365 for (
unsigned int vertex=0; vertex<GeometryInfo<1>::vertices_per_cell; ++vertex)
366 if (cell->vertex_dof_index(vertex, 0, fe_index) ==
369 cell->set_vertex_dof_index (vertex, d, next_free_dof, fe_index);
375 Assert ((cell->dof_index(0, fe_index) ==
379 for (
unsigned int d=0; d<fe.
dofs_per_line; ++d, ++next_free_dof)
380 cell->set_dof_index (d, next_free_dof, fe_index);
384 cell->set_user_flag ();
386 return next_free_dof;
390 template <
int spacedim>
396 const unsigned int dim = 2;
399 const unsigned int fe_index = cell->active_fe_index ();
410 for (
unsigned int vertex=0; vertex<GeometryInfo<2>::vertices_per_cell; ++vertex)
411 if (cell->vertex_dof_index(vertex, 0, fe_index) ==
414 cell->set_vertex_dof_index (vertex, d, next_free_dof, fe_index);
422 for (
unsigned int l=0; l<GeometryInfo<2>::lines_per_cell; ++l)
424 typename HpDoFHandler<dim,spacedim>::line_iterator
425 line = cell->line(l);
427 if (line->dof_index(0,fe_index) ==
429 for (
unsigned int d=0; d<fe.
dofs_per_line; ++d, ++next_free_dof)
430 line->set_dof_index (d, next_free_dof, fe_index);
438 Assert ((cell->dof_index(0, fe_index) ==
442 for (
unsigned int d=0; d<fe.
dofs_per_quad; ++d, ++next_free_dof)
443 cell->set_dof_index (d, next_free_dof, fe_index);
447 cell->set_user_flag ();
449 return next_free_dof;
453 template <
int spacedim>
459 const unsigned int dim = 3;
462 const unsigned int fe_index = cell->active_fe_index ();
473 for (
unsigned int vertex=0; vertex<GeometryInfo<3>::vertices_per_cell; ++vertex)
474 if (cell->vertex_dof_index(vertex, 0, fe_index) ==
477 cell->set_vertex_dof_index (vertex, d, next_free_dof, fe_index);
485 for (
unsigned int l=0; l<GeometryInfo<3>::lines_per_cell; ++l)
487 typename HpDoFHandler<dim,spacedim>::line_iterator
488 line = cell->line(l);
490 if (line->dof_index(0,fe_index) ==
492 for (
unsigned int d=0; d<fe.
dofs_per_line; ++d, ++next_free_dof)
493 line->set_dof_index (d, next_free_dof, fe_index);
498 for (
unsigned int q=0; q<GeometryInfo<3>::quads_per_cell; ++q)
500 typename HpDoFHandler<dim,spacedim>::quad_iterator
501 quad = cell->quad(q);
503 if (quad->dof_index(0,fe_index) ==
506 quad->set_dof_index (d, next_free_dof, fe_index);
514 Assert ((cell->dof_index(0, fe_index) ==
519 cell->set_dof_index (d, next_free_dof, fe_index);
523 cell->set_user_flag ();
525 return next_free_dof;
538 template <
int spacedim>
543 const unsigned int dim = 1;
547 Assert (dof_handler.finite_elements != 0,
549 Assert (dof_handler.finite_elements->size() > 0,
553 BaseClass::ExcInvalidTriangulation());
561 std::vector<std::vector<DoFLevel::active_fe_index_type> >
562 active_fe_backup(dof_handler.
levels.size ());
563 for (
unsigned int level = 0; level<dof_handler.
levels.size (); ++level)
564 std::swap (dof_handler.
levels[level]->active_fe_indices,
565 active_fe_backup[level]);
573 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
576 std::swap (active_fe_backup[level],
577 dof_handler.
levels[level]->active_fe_indices);
597 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
599 dof_handler.
levels[level]->dof_offsets
600 = std::vector<DoFLevel::offset_type> (
601 dof_handler.
tria->n_raw_lines(level),
603 dof_handler.
levels[level]->cell_cache_offsets
604 = std::vector<DoFLevel::offset_type> (
605 dof_handler.
tria->n_raw_lines(level),
610 typename HpDoFHandler<dim,spacedim>::active_cell_iterator
613 for (; cell!=endc; ++cell)
614 if (!cell->has_children())
616 dof_handler.
levels[level]->dof_offsets[cell->index()] = next_free_dof;
617 next_free_dof += cell->get_fe().dofs_per_line;
619 dof_handler.
levels[level]->cell_cache_offsets[cell->index()] = cache_size;
620 cache_size += cell->get_fe().dofs_per_cell;
623 dof_handler.
levels[level]->dof_indices
624 = std::vector<types::global_dof_index> (next_free_dof,
626 dof_handler.
levels[level]->cell_dof_indices_cache
627 = std::vector<types::global_dof_index> (cache_size,
639 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
642 typename HpDoFHandler<dim,spacedim>::active_cell_iterator
645 for (; cell!=endc; ++cell)
646 if (!cell->has_children())
647 counter += cell->get_fe().dofs_per_line;
649 Assert (dof_handler.
levels[level]->dof_indices.size() == counter,
651 Assert (static_cast<unsigned int>
652 (std::count (dof_handler.
levels[level]->dof_offsets.begin(),
653 dof_handler.
levels[level]->dof_offsets.end(),
656 dof_handler.
tria->n_raw_lines(level) - dof_handler.
tria->n_active_lines(level),
667 template <
int spacedim>
672 const unsigned int dim = 2;
676 Assert (dof_handler.finite_elements != 0,
678 Assert (dof_handler.finite_elements->size() > 0,
681 typename BaseClass::ExcInvalidTriangulation());
689 std::vector<std::vector<DoFLevel::active_fe_index_type> >
690 active_fe_backup(dof_handler.
levels.size ());
691 for (
unsigned int level = 0; level<dof_handler.
levels.size (); ++level)
692 std::swap (dof_handler.
levels[level]->active_fe_indices,
693 active_fe_backup[level]);
701 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
704 std::swap (active_fe_backup[level],
705 dof_handler.
levels[level]->active_fe_indices);
726 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
728 dof_handler.
levels[level]->dof_offsets
729 = std::vector<DoFLevel::offset_type> (
730 dof_handler.
tria->n_raw_quads(level),
732 dof_handler.
levels[level]->cell_cache_offsets
733 = std::vector<DoFLevel::offset_type> (
734 dof_handler.
tria->n_raw_quads(level),
739 typename HpDoFHandler<dim,spacedim>::active_cell_iterator
742 for (; cell!=endc; ++cell)
743 if (!cell->has_children())
745 dof_handler.
levels[level]->dof_offsets[cell->index()] = next_free_dof;
746 next_free_dof += cell->get_fe().dofs_per_quad;
748 dof_handler.
levels[level]->cell_cache_offsets[cell->index()] = cache_size;
749 cache_size += cell->get_fe().dofs_per_cell;
752 dof_handler.
levels[level]->dof_indices
753 = std::vector<types::global_dof_index> (next_free_dof,
755 dof_handler.
levels[level]->cell_dof_indices_cache
756 = std::vector<types::global_dof_index> (cache_size,
768 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
771 typename HpDoFHandler<dim,spacedim>::active_cell_iterator
774 for (; cell!=endc; ++cell)
775 if (!cell->has_children())
776 counter += cell->get_fe().dofs_per_quad;
778 Assert (dof_handler.
levels[level]->dof_indices.size() == counter,
780 Assert (static_cast<unsigned int>
781 (std::count (dof_handler.
levels[level]->dof_offsets.begin(),
782 dof_handler.
levels[level]->dof_offsets.end(),
785 dof_handler.
tria->n_raw_quads(level) - dof_handler.
tria->n_active_quads(level),
818 std::vector<bool> saved_line_user_flags;
820 .save_user_flags_line (saved_line_user_flags);
822 .clear_user_flags_line ();
828 unsigned int n_line_slots = 0;
830 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
832 for (
unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
833 if (! cell->face(face)->user_flag_set())
847 if (cell->at_boundary(face)
849 cell->face(face)->has_children()
851 cell->neighbor_is_coarser(face)
853 (!cell->at_boundary(face)
855 (cell->active_fe_index() == cell->neighbor(face)->active_fe_index())))
863 += (*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_line + 2;
873 += ((*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_line
875 (*dof_handler.finite_elements)[cell->neighbor(face)->active_fe_index()]
882 cell->face(face)->set_user_flag ();
893 dof_handler.
faces->lines.dof_offsets
894 = std::vector<unsigned int> (dof_handler.
tria->n_raw_lines(),
896 dof_handler.
faces->lines.dofs
897 = std::vector<types::global_dof_index> (n_line_slots,
906 .clear_user_flags_line ();
908 unsigned int next_free_line_slot = 0;
910 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
912 for (
unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
913 if (! cell->face(face)->user_flag_set())
917 if (cell->at_boundary(face)
919 cell->face(face)->has_children()
921 cell->neighbor_is_coarser(face)
923 (!cell->at_boundary(face)
925 (cell->active_fe_index() == cell->neighbor(face)->active_fe_index())))
928 ->lines.dof_offsets[cell->face(face)->index()]
929 = next_free_line_slot;
936 ->lines.dofs[next_free_line_slot]
937 = cell->active_fe_index();
959 += (*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_line + 2;
964 ->lines.dof_offsets[cell->face(face)->index()]
965 = next_free_line_slot;
972 ->lines.dofs[next_free_line_slot]
973 = cell->active_fe_index();
987 ->lines.dofs[next_free_line_slot
989 (*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_line
992 = cell->neighbor(face)->active_fe_index();
1012 += ((*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_line
1014 (*dof_handler.finite_elements)[cell->neighbor(face)->active_fe_index()]
1022 cell->face(face)->set_user_flag ();
1029 Assert (next_free_line_slot == n_line_slots,
1035 .load_user_flags_line (saved_line_user_flags);
1044 template <
int spacedim>
1049 const unsigned int dim = 3;
1053 Assert (dof_handler.finite_elements != 0,
1055 Assert (dof_handler.finite_elements->size() > 0,
1058 typename BaseClass::ExcInvalidTriangulation());
1066 std::vector<std::vector<DoFLevel::active_fe_index_type> >
1067 active_fe_backup(dof_handler.
levels.size ());
1068 for (
unsigned int level = 0; level<dof_handler.
levels.size (); ++level)
1069 std::swap (dof_handler.
levels[level]->active_fe_indices,
1070 active_fe_backup[level]);
1078 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
1081 std::swap (active_fe_backup[level],
1082 dof_handler.
levels[level]->active_fe_indices);
1103 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
1105 dof_handler.
levels[level]->dof_offsets
1106 = std::vector<DoFLevel::offset_type> (
1107 dof_handler.
tria->n_raw_hexs(level),
1109 dof_handler.
levels[level]->cell_cache_offsets
1110 = std::vector<DoFLevel::offset_type> (
1111 dof_handler.
tria->n_raw_hexs(level),
1116 typename HpDoFHandler<dim,spacedim>::active_cell_iterator
1119 for (; cell!=endc; ++cell)
1120 if (!cell->has_children())
1122 dof_handler.
levels[level]->dof_offsets[cell->index()] = next_free_dof;
1123 next_free_dof += cell->get_fe().dofs_per_hex;
1125 dof_handler.
levels[level]->cell_cache_offsets[cell->index()] = cache_size;
1126 cache_size += cell->get_fe().dofs_per_cell;
1129 dof_handler.
levels[level]->dof_indices
1130 = std::vector<types::global_dof_index> (next_free_dof,
1132 dof_handler.
levels[level]->cell_dof_indices_cache
1133 = std::vector<types::global_dof_index> (cache_size,
1145 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
1148 typename HpDoFHandler<dim,spacedim>::active_cell_iterator
1151 for (; cell!=endc; ++cell)
1152 if (!cell->has_children())
1153 counter += cell->get_fe().dofs_per_hex;
1155 Assert (dof_handler.
levels[level]->dof_indices.size() == counter,
1157 Assert (static_cast<unsigned int>
1158 (std::count (dof_handler.
levels[level]->dof_offsets.begin(),
1159 dof_handler.
levels[level]->dof_offsets.end(),
1162 dof_handler.
tria->n_raw_hexs(level) - dof_handler.
tria->n_active_hexs(level),
1195 std::vector<bool> saved_quad_user_flags;
1197 .save_user_flags_quad (saved_quad_user_flags);
1199 .clear_user_flags_quad ();
1204 unsigned int n_quad_slots = 0;
1206 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
1208 for (
unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
1209 if (! cell->face(face)->user_flag_set())
1226 if (cell->at_boundary(face)
1228 cell->face(face)->has_children()
1230 cell->neighbor_is_coarser(face)
1232 (!cell->at_boundary(face)
1234 (cell->active_fe_index() == cell->neighbor(face)->active_fe_index())))
1242 += (*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_quad + 2;
1252 += ((*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_quad
1254 (*dof_handler.finite_elements)[cell->neighbor(face)->active_fe_index()]
1261 cell->face(face)->set_user_flag ();
1274 dof_handler.
faces->quads.dof_offsets
1275 = std::vector<unsigned int>
1276 (dof_handler.
tria->n_raw_quads(),
1277 (
unsigned int)(-1));
1278 dof_handler.
faces->quads.dofs
1279 = std::vector<types::global_dof_index> (n_quad_slots,
1289 .clear_user_flags_quad ();
1291 unsigned int next_free_quad_slot = 0;
1293 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
1295 for (
unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
1296 if (! cell->face(face)->user_flag_set())
1300 if (cell->at_boundary(face)
1302 cell->face(face)->has_children()
1304 cell->neighbor_is_coarser(face)
1306 (!cell->at_boundary(face)
1308 (cell->active_fe_index() == cell->neighbor(face)->active_fe_index())))
1311 ->quads.dof_offsets[cell->face(face)->index()]
1312 = next_free_quad_slot;
1319 ->quads.dofs[next_free_quad_slot]
1320 = cell->active_fe_index();
1342 += (*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_quad + 2;
1347 ->quads.dof_offsets[cell->face(face)->index()]
1348 = next_free_quad_slot;
1355 ->quads.dofs[next_free_quad_slot]
1356 = cell->active_fe_index();
1370 ->quads.dofs[next_free_quad_slot
1372 (*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_quad
1375 = cell->neighbor(face)->active_fe_index();
1395 += ((*dof_handler.finite_elements)[cell->active_fe_index()].dofs_per_quad
1397 (*dof_handler.finite_elements)[cell->neighbor(face)->active_fe_index()]
1405 cell->face(face)->set_user_flag ();
1411 Assert (next_free_quad_slot == n_quad_slots,
1417 .load_user_flags_quad (saved_quad_user_flags);
1442 std::vector<std::vector<bool> >
1443 line_fe_association (dof_handler.finite_elements->size(),
1444 std::vector<bool> (dof_handler.
tria->n_raw_lines(),
1447 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
1449 cell!=dof_handler.
end(); ++cell)
1450 for (
unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++
l)
1451 line_fe_association[cell->active_fe_index()][cell->line_index(l)]
1463 std::vector<bool> line_is_used (dof_handler.
tria->n_raw_lines(),
false);
1464 for (
unsigned int line=0; line<dof_handler.
tria->n_raw_lines(); ++line)
1465 for (
unsigned int fe=0; fe<dof_handler.finite_elements->size(); ++fe)
1466 if (line_fe_association[fe][line] ==
true)
1468 line_is_used[line] =
true;
1483 dof_handler.
faces->lines.dof_offsets
1484 .resize (dof_handler.
tria->n_raw_lines(),
1487 unsigned int line_slots_needed = 0;
1488 for (
unsigned int line=0; line<dof_handler.
tria->n_raw_lines(); ++line)
1489 if (line_is_used[line] ==
true)
1491 dof_handler.
faces->lines.dof_offsets[line] = line_slots_needed;
1493 for (
unsigned int fe=0; fe<dof_handler.finite_elements->size(); ++fe)
1494 if (line_fe_association[fe][line] ==
true)
1495 line_slots_needed += (*dof_handler.finite_elements)[fe].dofs_per_line + 1;
1496 ++line_slots_needed;
1503 dof_handler.
faces->lines.dofs.resize (line_slots_needed,
1505 for (
unsigned int line=0; line<dof_handler.
tria->n_raw_lines(); ++line)
1506 if (line_is_used[line] ==
true)
1508 unsigned int pointer = dof_handler.
faces->lines.dof_offsets[line];
1509 for (
unsigned int fe=0; fe<dof_handler.finite_elements->size(); ++fe)
1510 if (line_fe_association[fe][line] ==
true)
1518 dof_handler.
faces->lines.dofs[pointer] = fe;
1519 pointer += (*dof_handler.finite_elements)[fe].dofs_per_line + 1;
1538 template <
int spacedim>
1543 return std::min(static_cast<types::global_dof_index> (3*
1545 2*dof_handler.finite_elements->max_dofs_per_line()),
1551 template <
int spacedim>
1578 switch (dof_handler.
tria->max_adjacent_cells())
1582 28*dof_handler.finite_elements->max_dofs_per_line() +
1583 8*dof_handler.finite_elements->max_dofs_per_quad();
1587 31*dof_handler.finite_elements->max_dofs_per_line() +
1588 9*dof_handler.finite_elements->max_dofs_per_quad();
1592 42*dof_handler.finite_elements->max_dofs_per_line() +
1593 12*dof_handler.finite_elements->max_dofs_per_quad();
1597 45*dof_handler.finite_elements->max_dofs_per_line() +
1598 13*dof_handler.finite_elements->max_dofs_per_quad();
1602 56*dof_handler.finite_elements->max_dofs_per_line() +
1603 16*dof_handler.finite_elements->max_dofs_per_quad();
1609 return std::min(max_couplings,dof_handler.
n_dofs());
1613 template <
int spacedim>
1628 const unsigned int max_adjacent_cells = dof_handler.
tria->max_adjacent_cells();
1631 if (max_adjacent_cells <= 8)
1633 7*6*7*3*dof_handler.finite_elements->max_dofs_per_line() +
1634 9*4*7*3*dof_handler.finite_elements->max_dofs_per_quad() +
1635 27*dof_handler.finite_elements->max_dofs_per_hex();
1642 return std::min(max_couplings,dof_handler.
n_dofs());
1652 template<
int dim,
int spacedim>
1655 template<
int dim,
int spacedim>
1658 template<
int dim,
int spacedim>
1663 template<
int dim,
int spacedim>
1666 tria(&tria, typeid(*this).name()),
1672 ExcMessage (
"The given triangulation is parallel distributed but " 1673 "this class does not currently support this."));
1675 create_active_fe_table ();
1677 tria_listeners.push_back
1678 (
tria.signals.pre_refinement
1680 std_cxx11::ref(*
this))));
1681 tria_listeners.push_back
1682 (
tria.signals.post_refinement
1684 std_cxx11::ref(*
this))));
1685 tria_listeners.push_back
1686 (
tria.signals.create
1688 std_cxx11::ref(*
this))));
1692 template<
int dim,
int spacedim>
1697 for (
unsigned int i=0; i<tria_listeners.size(); ++i)
1698 tria_listeners[i].disconnect ();
1699 tria_listeners.clear ();
1708 template <
int dim,
int spacedim>
1712 return cell_iterator (*this->get_triangulation().begin(level),
1718 template <
int dim,
int spacedim>
1726 while (i->has_children())
1734 template <
int dim,
int spacedim>
1745 template <
int dim,
int spacedim>
1749 return (level == this->get_triangulation().n_levels()-1 ?
1755 template <
int dim,
int spacedim>
1759 return (level == this->get_triangulation().n_levels()-1 ?
1761 begin_active (level+1));
1766 template <
int dim,
int spacedim>
1776 template <
int dim,
int spacedim>
1782 (begin_active(), end());
1787 template <
int dim,
int spacedim>
1793 (begin(level), end(level));
1798 template <
int dim,
int spacedim>
1804 (begin_active(level), end_active(level));
1822 cell = this->begin_active();
1823 while (!cell->at_boundary(0))
1824 cell = cell->neighbor(0);
1825 n += cell->
get_fe().dofs_per_vertex;
1828 cell = this->begin_active();
1829 while (!cell->at_boundary(1))
1830 cell = cell->neighbor(1);
1831 n += cell->
get_fe().dofs_per_vertex;
1839 template <
typename number>
1848 i!=boundary_ids.end(); ++i)
1849 Assert ((i->first == 0) || (i->first == 1),
1856 if (boundary_ids.find (0) != boundary_ids.end())
1858 cell = this->begin_active();
1859 while (!cell->at_boundary(0))
1860 cell = cell->neighbor(0);
1861 n += cell->
get_fe().dofs_per_vertex;
1865 if (boundary_ids.find (1) != boundary_ids.end())
1867 cell = this->begin_active();
1868 while (!cell->at_boundary(1))
1869 cell = cell->neighbor(1);
1870 n += cell->
get_fe().dofs_per_vertex;
1886 for (std::set<types::boundary_id>::const_iterator i=boundary_ids.begin();
1887 i!=boundary_ids.end(); ++i)
1888 Assert ((*i == 0) || (*i == 1),
1895 if (boundary_ids.find (0) != boundary_ids.end())
1897 cell = this->begin_active();
1898 while (!cell->at_boundary(0))
1899 cell = cell->neighbor(0);
1900 n += cell->
get_fe().dofs_per_vertex;
1904 if (boundary_ids.find (1) != boundary_ids.end())
1906 cell = this->begin_active();
1907 while (!cell->at_boundary(1))
1908 cell = cell->neighbor(1);
1909 n += cell->
get_fe().dofs_per_vertex;
1924 template <
typename number>
1948 template <
typename number>
1963 template<
int dim,
int spacedim>
1968 std::set<types::global_dof_index> boundary_dofs;
1969 std::vector<types::global_dof_index> dofs_on_face;
1982 typename HpDoFHandler<dim,spacedim>::active_cell_iterator cell = this->begin_active (),
1984 for (; cell!=endc; ++cell)
1985 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
1986 if (cell->at_boundary(f))
1988 const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
1989 dofs_on_face.resize (dofs_per_face);
1991 cell->face(f)->get_dof_indices (dofs_on_face,
1992 cell->active_fe_index());
1993 for (
unsigned int i=0; i<dofs_per_face; ++i)
1994 boundary_dofs.insert(dofs_on_face[i]);
1996 return boundary_dofs.size();
2001 template<
int dim,
int spacedim>
2012 std::set<types::global_dof_index> boundary_dofs;
2013 std::vector<types::global_dof_index> dofs_on_face;
2016 typename HpDoFHandler<dim,spacedim>::active_cell_iterator cell = this->begin_active (),
2018 for (; cell!=endc; ++cell)
2019 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
2020 if (cell->at_boundary(f) &&
2021 (boundary_ids.find(cell->face(f)->boundary_id()) !=
2022 boundary_ids.end()))
2024 const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
2025 dofs_on_face.resize (dofs_per_face);
2027 cell->face(f)->get_dof_indices (dofs_on_face,
2028 cell->active_fe_index());
2029 for (
unsigned int i=0; i<dofs_per_face; ++i)
2030 boundary_dofs.insert(dofs_on_face[i]);
2032 return boundary_dofs.size();
2047 template <
typename number>
2065 template<
int dim,
int spacedim>
2078 for (
unsigned int i=0; i<levels.size(); ++i)
2087 template<
int dim,
int spacedim>
2104 vertex_dof_identities (get_fe().size(),
2110 for (
unsigned int vertex_index=0; vertex_index<get_tria().n_vertices();
2113 const unsigned int n_active_fe_indices
2114 = ::internal::DoFAccessor::Implementation::
2115 n_active_vertex_fe_indices (*
this, vertex_index);
2116 if (n_active_fe_indices > 1)
2120 = ::internal::DoFAccessor::Implementation::
2121 nth_active_vertex_fe_index (*
this, vertex_index, 0);
2128 for (
unsigned int f=1; f<n_active_fe_indices; ++f)
2132 = ::internal::DoFAccessor::Implementation::
2133 nth_active_vertex_fe_index (*
this, vertex_index, f);
2139 ::internal::hp::ensure_existence_of_dof_identities<0>
2140 (get_fe()[first_fe_index],
2141 get_fe()[other_fe_index],
2142 vertex_dof_identities[first_fe_index][other_fe_index]);
2168 ::internal::hp::DoFIdentities &identities
2169 = *vertex_dof_identities[first_fe_index][other_fe_index];
2170 for (
unsigned int i=0; i<identities.size(); ++i)
2173 = ::internal::DoFAccessor::Implementation::
2174 get_vertex_dof_index (*
this,
2177 identities[i].first);
2179 = ::internal::DoFAccessor::Implementation::
2180 get_vertex_dof_index (*
this,
2183 identities[i].second);
2185 Assert ((new_dof_indices[higher_dof_index] ==
2188 (new_dof_indices[higher_dof_index] ==
2192 new_dof_indices[higher_dof_index] = lower_dof_index;
2221 template<
int dim,
int spacedim>
2228 std::vector<bool> user_flags;
2229 this->get_triangulation().save_user_flags_line(user_flags);
2249 line_dof_identities (finite_elements->size(),
2250 finite_elements->size());
2253 for (
unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
2254 if (cell->line(l)->user_flag_set() ==
false)
2256 const line_iterator line = cell->line(l);
2257 line->set_user_flag ();
2259 unsigned int unique_sets_of_dofs
2260 = line->n_active_fe_indices();
2264 for (
unsigned int f=0; f<line->n_active_fe_indices(); ++f)
2265 for (
unsigned int g=f+1; g<line->n_active_fe_indices(); ++g)
2267 const unsigned int fe_index_1 = line->nth_active_fe_index (f),
2268 fe_index_2 = line->nth_active_fe_index (g);
2270 if (((*finite_elements)[fe_index_1].dofs_per_line
2272 (*finite_elements)[fe_index_2].dofs_per_line)
2274 ((*finite_elements)[fe_index_1].dofs_per_line > 0))
2276 internal::hp::ensure_existence_of_dof_identities<1>
2277 ((*finite_elements)[fe_index_1],
2278 (*finite_elements)[fe_index_2],
2279 line_dof_identities[fe_index_1][fe_index_2]);
2282 if (line_dof_identities[fe_index_1][fe_index_2]->size()
2284 (*finite_elements)[fe_index_1].dofs_per_line)
2287 for (; i<(*finite_elements)[fe_index_1].dofs_per_line; ++i)
2288 if (((*(line_dof_identities[fe_index_1][fe_index_2]))[i].first != i)
2290 ((*(line_dof_identities[fe_index_1][fe_index_2]))[i].second != i))
2294 if (i == (*finite_elements)[fe_index_1].dofs_per_line)
2301 --unique_sets_of_dofs;
2303 for (
unsigned int j=0; j<(*finite_elements)[fe_index_1].dofs_per_line; ++j)
2306 = line->dof_index (j, fe_index_1);
2308 = line->dof_index (j, fe_index_2);
2313 if (new_dof_indices[master_dof_index] !=
2316 Assert (new_dof_indices[new_dof_indices[master_dof_index]] ==
2320 new_dof_indices[slave_dof_index]
2321 = new_dof_indices[master_dof_index];
2325 Assert ((new_dof_indices[master_dof_index] ==
2328 (new_dof_indices[slave_dof_index] ==
2332 new_dof_indices[slave_dof_index] = master_dof_index;
2348 if ((unique_sets_of_dofs == 2) && (dim == 2))
2352 const unsigned int most_dominating_fe_index
2353 = internal::hp::get_most_dominating_fe_index<dim,spacedim> (line);
2361 const unsigned int n_active_fe_indices
2362 = line->n_active_fe_indices ();
2367 for (
unsigned int f=0; f<n_active_fe_indices; ++f)
2368 if (line->nth_active_fe_index (f) !=
2369 most_dominating_fe_index)
2372 other_fe_index = line->nth_active_fe_index (f);
2374 internal::hp::ensure_existence_of_dof_identities<1>
2375 ((*finite_elements)[most_dominating_fe_index],
2376 (*finite_elements)[other_fe_index],
2377 line_dof_identities[most_dominating_fe_index][other_fe_index]);
2379 internal::hp::DoFIdentities &identities
2380 = *line_dof_identities[most_dominating_fe_index][other_fe_index];
2381 for (
unsigned int i=0; i<identities.size(); ++i)
2384 = line->dof_index (identities[i].first, most_dominating_fe_index);
2386 = line->dof_index (identities[i].second, other_fe_index);
2388 Assert ((new_dof_indices[master_dof_index] ==
2391 (new_dof_indices[slave_dof_index] ==
2395 new_dof_indices[slave_dof_index] = master_dof_index;
2404 .load_user_flags_line(user_flags);
2409 template <
int dim,
int spacedim>
2427 const int spacedim = 3;
2434 std::vector<bool> user_flags;
2435 this->get_triangulation().save_user_flags_quad(user_flags);
2459 quad_dof_identities (finite_elements->size(),
2460 finite_elements->size());
2462 for (active_cell_iterator cell=begin_active(); cell!=end(); ++cell)
2463 for (
unsigned int q=0; q<GeometryInfo<dim>::quads_per_cell; ++q)
2464 if ((cell->quad(q)->user_flag_set() ==
false)
2466 (cell->quad(q)->n_active_fe_indices() == 2))
2468 const quad_iterator quad = cell->quad(q);
2469 quad->set_user_flag ();
2475 const unsigned int most_dominating_fe_index
2476 = internal::hp::get_most_dominating_fe_index<dim,spacedim> (quad);
2484 const unsigned int n_active_fe_indices
2485 = quad->n_active_fe_indices ();
2493 for (
unsigned int f=0; f<n_active_fe_indices; ++f)
2494 if (quad->nth_active_fe_index (f) !=
2495 most_dominating_fe_index)
2498 other_fe_index = quad->nth_active_fe_index (f);
2500 internal::hp::ensure_existence_of_dof_identities<2>
2501 ((*finite_elements)[most_dominating_fe_index],
2502 (*finite_elements)[other_fe_index],
2503 quad_dof_identities[most_dominating_fe_index][other_fe_index]);
2505 internal::hp::DoFIdentities &identities
2506 = *quad_dof_identities[most_dominating_fe_index][other_fe_index];
2507 for (
unsigned int i=0; i<identities.size(); ++i)
2510 = quad->dof_index (identities[i].first, most_dominating_fe_index);
2512 = quad->dof_index (identities[i].second, other_fe_index);
2514 Assert ((new_dof_indices[master_dof_index] ==
2517 (new_dof_indices[slave_dof_index] ==
2521 new_dof_indices[slave_dof_index] = master_dof_index;
2529 .load_user_flags_quad(user_flags);
2534 template <
int dim,
int spacedim>
2537 Assert(active_fe_indices.size()==get_tria().n_active_cells(),
2540 create_active_fe_table ();
2550 for (
unsigned int i=0; cell!=endc; ++cell, ++i)
2551 cell->set_active_fe_index(active_fe_indices[i]);
2556 template <
int dim,
int spacedim>
2559 active_fe_indices.resize(get_tria().n_active_cells());
2567 for (
unsigned int i=0; cell!=endc; ++cell, ++i)
2568 active_fe_indices[i]=cell->active_fe_index();
2573 template<
int dim,
int spacedim>
2576 Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
2578 finite_elements = &ff;
2583 create_active_fe_table ();
2590 Assert (cell->active_fe_index() < finite_elements->size(),
2591 ExcInvalidFEIndex (cell->active_fe_index(),
2592 finite_elements->size()));
2607 std::vector<bool> user_flags;
2608 tria->save_user_flags(user_flags);
2621 for (; cell != endc; ++cell)
2623 = ::internal::hp::DoFHandler::Implementation::distribute_dofs_on_cell<spacedim> (cell,
2626 number_cache.n_global_dofs = next_free_dof;
2639 std::vector<types::global_dof_index>
2641 compute_vertex_dof_identities (constrained_indices);
2642 compute_line_dof_identities (constrained_indices);
2643 compute_quad_dof_identities (constrained_indices);
2648 std::vector<types::global_dof_index>
2654 new_dof_indices[i] = next_free_dof;
2664 Assert (new_dof_indices[constrained_indices[i]] !=
2668 new_dof_indices[i] = new_dof_indices[constrained_indices[i]];
2675 Assert (new_dof_indices[i] < next_free_dof,
2686 number_cache.n_global_dofs = next_free_dof;
2687 number_cache.n_locally_owned_dofs = number_cache.n_global_dofs;
2690 (&this->get_triangulation())
2693 number_cache.locally_owned_dofs
2694 =
IndexSet (number_cache.n_global_dofs);
2695 number_cache.locally_owned_dofs.add_range (0,
2696 number_cache.n_global_dofs);
2697 Assert (number_cache.n_global_dofs < std::numeric_limits<unsigned int>::max (),
2698 ExcMessage (
"Global number of degrees of freedom is too large."));
2699 number_cache.n_locally_owned_dofs_per_processor
2700 = std::vector<types::global_dof_index> (1,
2710 number_cache.locally_owned_dofs_per_processor
2711 = std::vector<IndexSet> (1,
2712 number_cache.locally_owned_dofs);
2718 cell != end(); ++cell)
2719 cell->update_cell_dof_indices_cache ();
2723 for (
int level=levels.size()-1; level>=0; --level)
2724 tg +=
Threads::new_task (&::internal::hp::DoFLevel::compress_data<dim,spacedim>,
2725 *levels[level], *finite_elements);
2735 template<
int dim,
int spacedim>
2739 finite_elements = 0;
2747 template<
int dim,
int spacedim>
2756 std::vector<types::global_dof_index> tmp(new_numbers);
2757 std::sort (tmp.begin(), tmp.end());
2758 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2760 for (; p!=tmp.end(); ++p, ++i)
2761 Assert (*p == i, ExcNewNumbersNotConsecutive(i));
2770 for (
int level=levels.size()-1; level>=0; --level)
2771 tg +=
Threads::new_task (&::internal::hp::DoFLevel::uncompress_data<dim,spacedim>,
2772 *levels[level], *finite_elements);
2781 cell != end(); ++cell)
2782 cell->update_cell_dof_indices_cache ();
2787 for (
int level=levels.size()-1; level>=0; --level)
2788 tg +=
Threads::new_task (&::internal::hp::DoFLevel::compress_data<dim,spacedim>,
2789 *levels[level], *finite_elements);
2796 template<
int dim,
int spacedim>
2804 for (
unsigned int vertex_index=0; vertex_index<get_tria().n_vertices();
2807 const unsigned int n_active_fe_indices
2808 = ::internal::DoFAccessor::Implementation::
2809 n_active_vertex_fe_indices (*
this, vertex_index);
2811 for (
unsigned int f=0; f<n_active_fe_indices; ++f)
2813 const unsigned int fe_index
2814 = ::internal::DoFAccessor::Implementation::
2815 nth_active_vertex_fe_index (*
this, vertex_index, f);
2817 for (
unsigned int d=0; d<(*finite_elements)[fe_index].dofs_per_vertex; ++d)
2820 = ::internal::DoFAccessor::Implementation::
2821 get_vertex_dof_index(*
this,
2825 ::internal::DoFAccessor::Implementation::
2826 set_vertex_dof_index (*
this,
2830 new_numbers[vertex_dof_index]);
2838 template<
int dim,
int spacedim>
2851 std::vector<bool> saved_line_user_flags;
2857 for (active_cell_iterator cell = begin_active(); cell!=end(); ++cell)
2858 for (
unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
2859 if (cell->line(l)->user_flag_set() ==
false)
2861 const line_iterator line = cell->line(l);
2862 line->set_user_flag();
2864 const unsigned int n_active_fe_indices
2865 = line->n_active_fe_indices ();
2867 for (
unsigned int f=0; f<n_active_fe_indices; ++f)
2869 const unsigned int fe_index
2870 = line->nth_active_fe_index (f);
2872 for (
unsigned int d=0; d<(*finite_elements)[fe_index].dofs_per_line; ++d)
2873 line->set_dof_index (d,
2874 new_numbers[line->dof_index(d,fe_index)],
2894 const unsigned int dim = 2;
2895 const unsigned int spacedim = 2;
2904 std::vector<bool> saved_quad_user_flags;
2910 for (active_cell_iterator cell = begin_active(); cell!=end(); ++cell)
2911 for (
unsigned int q=0; q<GeometryInfo<dim>::quads_per_cell; ++q)
2912 if (cell->quad(q)->user_flag_set() ==
false)
2914 const quad_iterator quad = cell->quad(q);
2915 quad->set_user_flag();
2917 const unsigned int n_active_fe_indices
2918 = quad->n_active_fe_indices ();
2920 for (
unsigned int f=0; f<n_active_fe_indices; ++f)
2922 const unsigned int fe_index
2923 = quad->nth_active_fe_index (f);
2925 for (
unsigned int d=0;
d<(*finite_elements)[fe_index].dofs_per_quad; ++
d)
2926 quad->set_dof_index (d,
2927 new_numbers[quad->dof_index(d,fe_index)],
2946 const unsigned int dim = 2;
2947 const unsigned int spacedim = 3;
2956 std::vector<bool> saved_quad_user_flags;
2962 for (active_cell_iterator cell = begin_active(); cell!=end(); ++cell)
2963 for (
unsigned int q=0; q<GeometryInfo<dim>::quads_per_cell; ++q)
2964 if (cell->quad(q)->user_flag_set() ==
false)
2966 const quad_iterator quad = cell->quad(q);
2967 quad->set_user_flag();
2969 const unsigned int n_active_fe_indices
2970 = quad->n_active_fe_indices ();
2972 for (
unsigned int f=0; f<n_active_fe_indices; ++f)
2974 const unsigned int fe_index
2975 = quad->nth_active_fe_index (f);
2977 for (
unsigned int d=0;
d<(*finite_elements)[fe_index].dofs_per_quad; ++
d)
2978 quad->set_dof_index (d,
2979 new_numbers[quad->dof_index(d,fe_index)],
2997 const unsigned int dim = 3;
2998 const unsigned int spacedim = 3;
3007 std::vector<bool> saved_quad_user_flags;
3013 for (active_cell_iterator cell = begin_active(); cell!=end(); ++cell)
3014 for (
unsigned int q=0; q<GeometryInfo<dim>::quads_per_cell; ++q)
3015 if (cell->quad(q)->user_flag_set() ==
false)
3017 const quad_iterator quad = cell->quad(q);
3018 quad->set_user_flag();
3020 const unsigned int n_active_fe_indices
3021 = quad->n_active_fe_indices ();
3023 for (
unsigned int f=0; f<n_active_fe_indices; ++f)
3025 const unsigned int fe_index
3026 = quad->nth_active_fe_index (f);
3028 for (
unsigned int d=0;
d<(*finite_elements)[fe_index].dofs_per_quad; ++
d)
3029 quad->set_dof_index (d,
3030 new_numbers[quad->dof_index(d,fe_index)],
3048 const unsigned int dim = 3;
3049 const unsigned int spacedim = 3;
3058 std::vector<bool> saved_hex_user_flags;
3068 for (active_cell_iterator cell = begin_active(); cell!=end(); ++cell)
3069 if (cell->user_flag_set() ==
false)
3071 const hex_iterator hex = cell;
3072 hex->set_user_flag();
3074 const unsigned int n_active_fe_indices
3075 = hex->n_active_fe_indices ();
3077 for (
unsigned int f=0; f<n_active_fe_indices; ++f)
3079 const unsigned int fe_index
3080 = hex->nth_active_fe_index (f);
3082 for (
unsigned int d=0;
d<(*finite_elements)[fe_index].dofs_per_hex; ++
d)
3083 hex->set_dof_index (d,
3084 new_numbers[hex->dof_index(d,fe_index)],
3097 template <
int dim,
int spacedim>
3102 return ::internal::hp::DoFHandler::Implementation::max_couplings_between_dofs (*
this);
3107 template <
int dim,
int spacedim>
3116 return finite_elements->max_dofs_per_vertex();
3118 return (3*finite_elements->max_dofs_per_vertex()
3120 2*finite_elements->max_dofs_per_line());
3135 return (19*finite_elements->max_dofs_per_vertex() +
3136 28*finite_elements->max_dofs_per_line() +
3137 8*finite_elements->max_dofs_per_quad());
3146 template<
int dim,
int spacedim>
3151 while (levels.size () < tria->n_levels ())
3152 levels.push_back (new ::internal::hp::DoFLevel);
3159 for (
unsigned int level=0; level<levels.size(); ++level)
3161 if (levels[level]->active_fe_indices.size () == 0)
3162 levels[level]->active_fe_indices.resize (tria->n_raw_cells(level),
3174 Assert (levels[level]->active_fe_indices.size () ==
3175 tria->n_raw_cells(level),
3185 levels[level]->normalize_active_fe_indices ();
3190 template <
int dim,
int spacedim>
3193 create_active_fe_table ();
3200 for (
unsigned int i=0; i<levels.size(); ++i)
3202 const unsigned int cells_on_level = tria->n_raw_cells(i);
3203 std::vector<bool> *has_children_level =
3204 new std::vector<bool> (cells_on_level);
3210 std::transform (tria->levels[i]->cells.children.begin (),
3211 tria->levels[i]->cells.children.end (),
3212 has_children_level->begin (),
3213 std_cxx11::bind(std::not_equal_to<int>(),
3217 std::transform (tria->levels[i]->cells.refinement_cases.begin (),
3218 tria->levels[i]->cells.refinement_cases.end (),
3219 has_children_level->begin (),
3220 std_cxx11::bind (std::not_equal_to<unsigned char>(),
3224 has_children.push_back (has_children_level);
3230 template<
int dim,
int spacedim>
3238 while (levels.size () < tria->n_levels ())
3239 levels.push_back (new ::internal::hp::DoFLevel);
3243 while (levels.size () > tria->n_levels ())
3245 delete levels[levels.size ()-1];
3254 for (
unsigned int i=0; i<levels.size(); ++i)
3255 levels[i]->active_fe_indices.resize (tria->n_raw_cells(i), 0);
3271 if (finite_elements != 0)
3273 cell_iterator cell = begin(),
3275 for (; cell != endc; ++cell)
3293 if (cell->has_children () &&
3294 !(*has_children [cell->level ()])[cell->index ()])
3302 for (
unsigned int i = 0; i < cell->n_children(); ++i)
3303 cell->child (i)->set_active_fe_index
3304 (levels[cell->level()]->active_fe_index (cell->index()));
3310 std::vector<std::vector<bool> *>::iterator children_level;
3311 for (children_level = has_children.begin ();
3312 children_level != has_children.end ();
3314 delete (*children_level);
3315 has_children.clear ();
3319 template <
int dim,
int spacedim>
3320 template <
int structdim>
3325 const unsigned int)
const 3332 template <
int dim,
int spacedim>
3333 template <
int structdim>
3345 template<
int dim,
int spacedim>
3348 for (
unsigned int i=0; i<levels.size(); ++i)
3355 std::vector<types::global_dof_index> tmp;
3356 std::swap (vertex_dofs, tmp);
3360 std::vector<types::global_dof_index> tmp;
3361 std::swap (vertex_dofs_offsets, tmp);
3369 #include "dof_handler.inst" 3372 DEAL_II_NAMESPACE_CLOSE
IteratorRange< active_cell_iterator > active_cell_iterators_on_level(const unsigned int level) const
unsigned int max_couplings_between_dofs() const
static const unsigned int invalid_unsigned_int
void load_user_flags_line(std::istream &in)
DoFHandler(const Triangulation< dim, spacedim > &tria)
cell_iterator begin(const unsigned int level=0) const
void save_user_flags_quad(std::ostream &out) const
void load_user_flags(std::istream &in)
cell_iterator end() const
const unsigned int dofs_per_quad
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_quad_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
void clear_user_flags_quad()
unsigned int max_dofs_per_face(const DoFHandler< dim, spacedim > &dh)
std::vector<::internal::DoFHandler::DoFLevel< dim > * > levels
ActiveSelector::active_cell_iterator active_cell_iterator
SmartPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
unsigned int max_dofs_per_vertex(const DoFHandler< dim, spacedim > &dh)
#define AssertThrow(cond, exc)
virtual std::size_t memory_consumption() const
static unsigned int max_couplings_between_dofs(const DoFHandler< 1, spacedim > &dof_handler)
const FiniteElement< dim, spacedim > & get_fe() const
const unsigned int dofs_per_line
void load_user_flags_quad(std::istream &in)
ActiveSelector::active_cell_iterator active_cell_iterator
active_cell_iterator begin_active(const unsigned int level=0) const
const hp::FECollection< dim, spacedim > & get_fe() const
void load_user_flags_hex(std::istream &in)
static ::ExceptionBase & ExcMessage(std::string arg1)
void save_user_flags_line(std::ostream &out) const
void clear_user_flags_hex()
unsigned int global_dof_index
static types::global_dof_index distribute_dofs_on_cell(const typename ::hp::DoFHandler< 1, spacedim >::active_cell_iterator &cell, types::global_dof_index next_free_dof)
const unsigned int dofs_per_hex
#define Assert(cond, exc)
IteratorRange< active_cell_iterator > active_cell_iterators() const
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
active_cell_iterator end_active(const unsigned int level) const
types::global_dof_index n_boundary_dofs() const
types::global_dof_index n_dofs() const
static void reserve_space_vertices(DoFHandler< dim, spacedim > &dof_handler)
static ::ExceptionBase & ExcRenumberingIncomplete()
::internal::DoFHandler::DoFFaces< dim > * faces
ActiveSelector::cell_iterator cell_iterator
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_vertex_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
static void reserve_space(DoFHandler< 1, spacedim > &dof_handler)
void save_user_flags_hex(std::ostream &out) const
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
virtual std::vector< std::pair< unsigned int, unsigned int > > hp_line_dof_identities(const FiniteElement< dim, spacedim > &fe_other) const
virtual void distribute_dofs(const FiniteElement< dim, spacedim > &fe)
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
static ::ExceptionBase & ExcNotImplemented()
Iterator points to a valid object.
const unsigned int dofs_per_vertex
unsigned char boundary_id
const types::boundary_id internal_face_boundary_id
unsigned int max_couplings_between_boundary_dofs() const
void clear_user_flags_line()
const types::global_dof_index invalid_dof_index
static ::ExceptionBase & ExcNoFESelected()
IteratorRange< cell_iterator > cell_iterators() const
virtual FiniteElementDomination::Domination compare_for_face_domination(const FiniteElement< dim, spacedim > &fe_other) const
std::vector< types::global_dof_index > vertex_dofs
Task< RT > new_task(const std_cxx11::function< RT()> &function)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
static ::ExceptionBase & ExcInternalError()