16 #include <deal.II/base/memory_consumption.h> 17 #include <deal.II/dofs/dof_handler.h> 18 #include <deal.II/dofs/dof_handler_policy.h> 19 #include <deal.II/dofs/dof_levels.h> 20 #include <deal.II/dofs/dof_faces.h> 21 #include <deal.II/dofs/dof_accessor.h> 22 #include <deal.II/grid/tria_accessor.h> 23 #include <deal.II/grid/tria_iterator.h> 24 #include <deal.II/grid/tria_levels.h> 25 #include <deal.II/grid/tria.h> 26 #include <deal.II/base/geometry_info.h> 27 #include <deal.II/fe/fe.h> 28 #include <deal.II/distributed/shared_tria.h> 29 #include <deal.II/distributed/tria.h> 34 DEAL_II_NAMESPACE_OPEN
41 template<
int dim,
int spacedim>
44 template<
int dim,
int spacedim>
47 template <
int dim,
int spacedim>
50 template <
int dim,
int spacedim>
58 template <
int dim,
int spacedim>
69 template<
int dim,
int spacedim>
70 std::string policy_to_string(const ::internal::DoFHandler::Policy::PolicyBase<dim,spacedim> &policy)
72 std::string policy_name;
73 if (
dynamic_cast<const typename ::internal::DoFHandler::Policy::Sequential<dim,spacedim>*
>(&policy))
74 policy_name =
"Policy::Sequential<";
75 else if (
dynamic_cast<const typename ::internal::DoFHandler::Policy::ParallelDistributed<dim,spacedim>*
>(&policy))
76 policy_name =
"Policy::ParallelDistributed<";
77 else if (
dynamic_cast<const typename ::internal::DoFHandler::Policy::ParallelShared<dim,spacedim>*
>(&policy))
78 policy_name =
"Policy::ParallelShared<";
105 template <
int spacedim>
110 return std::min(static_cast<types::global_dof_index>(3*dof_handler.
selected_fe->dofs_per_vertex +
117 template <
int spacedim>
145 switch (dof_handler.
tria->max_adjacent_cells())
148 max_couplings=19*dof_handler.
selected_fe->dofs_per_vertex +
153 max_couplings=21*dof_handler.
selected_fe->dofs_per_vertex +
158 max_couplings=28*dof_handler.
selected_fe->dofs_per_vertex +
163 max_couplings=30*dof_handler.
selected_fe->dofs_per_vertex +
168 max_couplings=37*dof_handler.
selected_fe->dofs_per_vertex +
178 max_couplings=39*dof_handler.
selected_fe->dofs_per_vertex +
183 max_couplings=46*dof_handler.
selected_fe->dofs_per_vertex +
188 max_couplings=48*dof_handler.
selected_fe->dofs_per_vertex +
193 max_couplings=55*dof_handler.
selected_fe->dofs_per_vertex +
198 max_couplings=57*dof_handler.
selected_fe->dofs_per_vertex +
203 max_couplings=63*dof_handler.
selected_fe->dofs_per_vertex +
208 max_couplings=65*dof_handler.
selected_fe->dofs_per_vertex +
213 max_couplings=72*dof_handler.
selected_fe->dofs_per_vertex +
219 Assert (
false, ExcNotImplemented());
222 return std::min(max_couplings,dof_handler.
n_dofs());
226 template <
int spacedim>
244 const unsigned int max_adjacent_cells
245 = dof_handler.
tria->max_adjacent_cells();
248 if (max_adjacent_cells <= 8)
249 max_couplings=7*7*7*dof_handler.
selected_fe->dofs_per_vertex +
255 Assert (
false, ExcNotImplemented());
259 return std::min(max_couplings,dof_handler.
n_dofs());
272 template <
int spacedim>
277 .resize(dof_handler.
tria->n_vertices() *
281 for (
unsigned int i=0; i<dof_handler.
tria->n_levels(); ++i)
286 dof_handler.
levels.back()->dof_object.dofs
287 .resize (dof_handler.
tria->n_raw_cells(i) *
291 dof_handler.
levels.back()->cell_dof_indices_cache
292 .resize (dof_handler.
tria->n_raw_cells(i) *
299 template <
int spacedim>
304 .resize(dof_handler.
tria->n_vertices() *
308 for (
unsigned int i=0; i<dof_handler.
tria->n_levels(); ++i)
312 dof_handler.
levels.back()->dof_object.dofs
313 .resize (dof_handler.
tria->n_raw_cells(i) *
317 dof_handler.
levels.back()->cell_dof_indices_cache
318 .resize (dof_handler.
tria->n_raw_cells(i) *
325 if (dof_handler.
tria->n_cells() > 0)
327 dof_handler.
faces->lines.dofs
328 .resize (dof_handler.
tria->n_raw_lines() *
335 template <
int spacedim>
340 .resize(dof_handler.
tria->n_vertices() *
344 for (
unsigned int i=0; i<dof_handler.
tria->n_levels(); ++i)
348 dof_handler.
levels.back()->dof_object.dofs
349 .resize (dof_handler.
tria->n_raw_cells(i) *
353 dof_handler.
levels.back()->cell_dof_indices_cache
354 .resize (dof_handler.
tria->n_raw_cells(i) *
361 if (dof_handler.
tria->n_cells() > 0)
363 dof_handler.
faces->lines.dofs
364 .resize (dof_handler.
tria->n_raw_lines() *
367 dof_handler.
faces->quads.dofs
368 .resize (dof_handler.
tria->n_raw_quads() *
374 template<
int spacedim>
379 dof_handler.clear_mg_space ();
382 const unsigned int &dofs_per_line = dof_handler.
get_fe ().dofs_per_line;
383 const unsigned int &n_levels = tria.n_levels ();
385 for (
unsigned int i = 0; i < n_levels; ++i)
388 dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_lines (i) * dofs_per_line,
DoFHandler<1>::invalid_dof_index);
391 const unsigned int &n_vertices = tria.n_vertices ();
395 std::vector<unsigned int> max_level (n_vertices, 0);
396 std::vector<unsigned int> min_level (n_vertices, n_levels);
398 for (typename ::Triangulation<1, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell)
400 const unsigned int level = cell->level ();
402 for (
unsigned int vertex = 0; vertex < GeometryInfo<1>::vertices_per_cell; ++vertex)
404 const unsigned int vertex_index = cell->vertex_index (vertex);
406 if (min_level[vertex_index] > level)
407 min_level[vertex_index] = level;
409 if (max_level[vertex_index] < level)
410 max_level[vertex_index] = level;
414 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
415 if (tria.vertex_used (vertex))
417 Assert (min_level[vertex] < n_levels, ExcInternalError ());
418 Assert (max_level[vertex] >= min_level[vertex], ExcInternalError ());
419 dof_handler.
mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], dof_handler.
get_fe ().dofs_per_vertex);
424 Assert (min_level[vertex] == n_levels, ExcInternalError ());
425 Assert (max_level[vertex] == 0, ExcInternalError ());
430 template<
int spacedim>
435 dof_handler.clear_mg_space ();
437 const ::FiniteElement<2, spacedim> &fe = dof_handler.
get_fe ();
439 const unsigned int &n_levels = tria.n_levels ();
441 for (
unsigned int i = 0; i < n_levels; ++i)
444 dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_quads (i) * fe.dofs_per_quad,
DoFHandler<2>::invalid_dof_index);
450 const unsigned int &n_vertices = tria.n_vertices ();
454 std::vector<unsigned int> max_level (n_vertices, 0);
455 std::vector<unsigned int> min_level (n_vertices, n_levels);
457 for (typename ::Triangulation<2, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell)
459 const unsigned int level = cell->level ();
461 for (
unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex)
463 const unsigned int vertex_index = cell->vertex_index (vertex);
465 if (min_level[vertex_index] > level)
466 min_level[vertex_index] = level;
468 if (max_level[vertex_index] < level)
469 max_level[vertex_index] = level;
473 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
474 if (tria.vertex_used (vertex))
476 Assert (min_level[vertex] < n_levels, ExcInternalError ());
477 Assert (max_level[vertex] >= min_level[vertex], ExcInternalError ());
478 dof_handler.
mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], fe.dofs_per_vertex);
483 Assert (min_level[vertex] == n_levels, ExcInternalError ());
484 Assert (max_level[vertex] == 0, ExcInternalError ());
489 template<
int spacedim>
494 dof_handler.clear_mg_space ();
496 const ::FiniteElement<3, spacedim> &fe = dof_handler.
get_fe ();
498 const unsigned int &n_levels = tria.n_levels ();
500 for (
unsigned int i = 0; i < n_levels; ++i)
503 dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_hexs (i) * fe.dofs_per_hex,
DoFHandler<3>::invalid_dof_index);
510 const unsigned int &n_vertices = tria.n_vertices ();
514 std::vector<unsigned int> max_level (n_vertices, 0);
515 std::vector<unsigned int> min_level (n_vertices, n_levels);
517 for (typename ::Triangulation<3, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell)
519 const unsigned int level = cell->level ();
521 for (
unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex)
523 const unsigned int vertex_index = cell->vertex_index (vertex);
525 if (min_level[vertex_index] > level)
526 min_level[vertex_index] = level;
528 if (max_level[vertex_index] < level)
529 max_level[vertex_index] = level;
533 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
534 if (tria.vertex_used (vertex))
536 Assert (min_level[vertex] < n_levels, ExcInternalError ());
537 Assert (max_level[vertex] >= min_level[vertex], ExcInternalError ());
538 dof_handler.
mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], fe.dofs_per_vertex);
543 Assert (min_level[vertex] == n_levels, ExcInternalError ());
544 Assert (max_level[vertex] == 0, ExcInternalError ());
549 template<
int spacedim>
556 for (
unsigned int vertex = 0; vertex < GeometryInfo<1>::vertices_per_cell; ++vertex)
561 if (neighbor->user_flag_set () && (neighbor->level () == cell->level ()))
565 cell->set_mg_vertex_dof_index (cell->level (), 0, dof, neighbor->mg_vertex_dof_index (cell->level (), 1, dof));
569 cell->set_mg_vertex_dof_index (cell->level (), 1, dof, neighbor->mg_vertex_dof_index (cell->level (), 0, dof));
575 cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
580 cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
582 cell->set_user_flag ();
583 return next_free_dof;
586 template<
int spacedim>
593 for (
unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex)
596 cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
599 for (
unsigned int face = 0; face < GeometryInfo<2>::faces_per_cell; ++face)
601 typename DoFHandler<2, spacedim>::line_iterator line = cell->line (face);
605 line->set_mg_dof_index (cell->level (), dof, next_free_dof++);
610 cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
612 cell->set_user_flag ();
613 return next_free_dof;
616 template<
int spacedim>
623 for (
unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex)
626 cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
629 for (
unsigned int line = 0; line < GeometryInfo<3>::lines_per_cell; ++line)
631 typename DoFHandler<3, spacedim>::line_iterator line_it = cell->line (line);
635 line_it->set_mg_dof_index (cell->level (), dof, next_free_dof++);
639 for (
unsigned int face = 0; face < GeometryInfo<3>::quads_per_cell; ++face)
641 typename DoFHandler<3, spacedim>::quad_iterator quad = cell->quad (face);
645 quad->set_mg_dof_index (cell->level (), dof, next_free_dof++);
649 for (
unsigned int dof = 0; dof < fe.
dofs_per_hex; ++dof)
650 cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
652 cell->set_user_flag ();
653 return next_free_dof;
656 template<
int spacedim>
663 const unsigned int obj_index,
664 const unsigned int fe_index,
665 const unsigned int local_index,
668 return mg_level.
dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
671 template<
int spacedim>
679 template<
int spacedim>
684 return mg_level.
dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
687 template<
int spacedim>
695 template<
int spacedim>
703 template<
int spacedim>
708 return mg_level.
dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
711 template<
int spacedim>
715 mg_level.
dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
718 template<
int spacedim>
722 mg_faces.
lines.
set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
725 template<
int spacedim>
729 mg_level.
dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
732 template<
int spacedim>
736 mg_faces.
lines.
set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
739 template<
int spacedim>
743 mg_faces.
quads.
set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
746 template<
int spacedim>
750 mg_level.
dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
758 template<
int dim,
int spacedim>
761 tria(&tria, typeid(*this).name()),
762 selected_fe(0, typeid(*this).name()),
782 template<
int dim,
int spacedim>
785 tria(0, typeid(*this).name()),
792 template <
int dim,
int spacedim>
800 template<
int dim,
int spacedim>
831 template <
int dim,
int spacedim>
843 template <
int dim,
int spacedim>
851 while (i->has_children())
859 template <
int dim,
int spacedim>
870 template <
int dim,
int spacedim>
881 template <
int dim,
int spacedim>
893 template <
int dim,
int spacedim>
894 typename DoFHandler<dim, spacedim>::level_cell_iterator
902 return level_cell_iterator (*cell,
this);
906 template <
int dim,
int spacedim>
907 typename DoFHandler<dim, spacedim>::level_cell_iterator
915 return level_cell_iterator (*cell,
this);
919 template <
int dim,
int spacedim>
920 typename DoFHandler<dim, spacedim>::level_cell_iterator
928 template <
int dim,
int spacedim>
938 template <
int dim,
int spacedim>
949 template <
int dim,
int spacedim>
961 template <
int dim,
int spacedim>
972 template <
int dim,
int spacedim>
983 template <
int dim,
int spacedim>
1001 return 2*
get_fe().dofs_per_vertex;
1012 for (FunctionMap::const_iterator i=boundary_ids.begin();
1013 i!=boundary_ids.end(); ++i)
1014 Assert ((i->first == 0) || (i->first == 1),
1015 ExcInvalidBoundaryIndicator());
1017 return boundary_ids.size()*
get_fe().dofs_per_vertex;
1028 for (std::set<types::boundary_id>::const_iterator i=boundary_ids.begin();
1029 i!=boundary_ids.end(); ++i)
1030 Assert ((*i == 0) || (*i == 1),
1031 ExcInvalidBoundaryIndicator());
1033 return boundary_ids.size()*
get_fe().dofs_per_vertex;
1040 return 2*
get_fe().dofs_per_vertex;
1051 for (FunctionMap::const_iterator i=boundary_ids.begin();
1052 i!=boundary_ids.end(); ++i)
1053 Assert ((i->first == 0) || (i->first == 1),
1054 ExcInvalidBoundaryIndicator());
1056 return boundary_ids.size()*
get_fe().dofs_per_vertex;
1067 for (std::set<types::boundary_id>::const_iterator i=boundary_ids.begin();
1068 i!=boundary_ids.end(); ++i)
1069 Assert ((*i == 0) || (*i == 1),
1070 ExcInvalidBoundaryIndicator());
1072 return boundary_ids.size()*
get_fe().dofs_per_vertex;
1077 template<
int dim,
int spacedim>
1080 std::set<int> boundary_dofs;
1082 const unsigned int dofs_per_face =
get_fe().dofs_per_face;
1083 std::vector<types::global_dof_index> dofs_on_face(dofs_per_face);
1101 for (; cell!=endc; ++cell)
1102 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
1103 if (cell->at_boundary(f))
1105 cell->face(f)->get_dof_indices (dofs_on_face);
1106 for (
unsigned int i=0; i<dofs_per_face; ++i)
1107 boundary_dofs.insert(dofs_on_face[i]);
1110 return boundary_dofs.size();
1115 template<
int dim,
int spacedim>
1120 ExcInvalidBoundaryIndicator());
1122 std::set<int> boundary_dofs;
1124 const unsigned int dofs_per_face =
get_fe().dofs_per_face;
1125 std::vector<types::global_dof_index> dofs_on_face(dofs_per_face);
1132 for (; cell!=endc; ++cell)
1133 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
1134 if (cell->at_boundary(f)
1136 (boundary_ids.find(cell->face(f)->boundary_id()) !=
1137 boundary_ids.end()))
1139 cell->face(f)->get_dof_indices (dofs_on_face);
1140 for (
unsigned int i=0; i<dofs_per_face; ++i)
1141 boundary_dofs.insert(dofs_on_face[i]);
1144 return boundary_dofs.size();
1149 template<
int dim,
int spacedim>
1154 ExcInvalidBoundaryIndicator());
1156 std::set<int> boundary_dofs;
1158 const unsigned int dofs_per_face =
get_fe().dofs_per_face;
1159 std::vector<types::global_dof_index> dofs_on_face(dofs_per_face);
1166 for (; cell!=endc; ++cell)
1167 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
1168 if (cell->at_boundary(f)
1170 (std::find (boundary_ids.begin(),
1172 cell->face(f)->boundary_id()) !=
1173 boundary_ids.end()))
1175 cell->face(f)->get_dof_indices (dofs_on_face);
1176 for (
unsigned int i=0; i<dofs_per_face; ++i)
1177 boundary_dofs.insert(dofs_on_face[i]);
1180 return boundary_dofs.size();
1185 template<
int dim,
int spacedim>
1198 for (
unsigned int i=0; i<
levels.size(); ++i)
1201 for (
unsigned int level = 0; level < mg_levels.size (); ++level)
1215 template<
int dim,
int spacedim>
1251 template<
int dim,
int spacedim>
1255 Assert(
levels.size()>0,
ExcMessage(
"Distribute active DoFs using distribute_dofs() before calling distribute_mg_dofs()."));
1259 Assert(old_fe == &fe,
ExcMessage(
"You are required to use the same FE for level and active DoFs!") );
1263 internal::DoFHandler::Implementation::reserve_space_mg (*
this);
1280 template<
int dim,
int spacedim>
1286 template<
int dim,
int spacedim>
1289 for (
unsigned int i = 0; i < mg_levels.size (); ++i)
1290 delete mg_levels[i];
1296 std::vector<MGVertexDoFs> tmp;
1304 template<
int dim,
int spacedim>
1312 template<
int dim,
int spacedim>
1325 template <
int dim,
int spacedim>
1332 ExcRenumberingIncomplete());
1346 std::vector<types::global_dof_index> tmp(new_numbers);
1347 std::sort (tmp.begin(), tmp.end());
1348 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
1350 for (; p!=tmp.end(); ++p, ++i)
1351 Assert (*p == i, ExcNewNumbersNotConsecutive(i));
1356 ExcMessage (
"New DoF index is not less than the total number of dofs."));
1359 policy->renumber_dofs (new_numbers, *
this,
number_cache);
1363 template <
int dim,
int spacedim>
1366 const std::vector<types::global_dof_index> &)
1368 Assert(
false, ExcNotImplemented());
1374 const std::vector<types::global_dof_index> &new_numbers)
1377 ExcMessage(
"You need to distribute active and level DoFs before you can renumber level DoFs."));
1386 for (std::vector<MGVertexDoFs>::iterator i=
mg_vertex_dofs.begin();
1390 if ((i->get_coarsest_level() <= level) &&
1391 (i->get_finest_level() >= level))
1392 for (
unsigned int d=0; d<this->
get_fe().dofs_per_vertex; ++d)
1393 i->set_index (level, d, new_numbers[i->get_index (level, d)]);
1395 for (std::vector<types::global_dof_index>::iterator i=mg_levels[level]->dof_object.dofs.begin();
1396 i!=mg_levels[level]->dof_object.dofs.end(); ++i)
1400 Assert(*i<new_numbers.size(), ExcInternalError());
1401 *i = new_numbers[*i];
1410 const std::vector<types::global_dof_index> &new_numbers)
1413 ExcMessage(
"You need to distribute active and level DoFs before you can renumber level DoFs."));
1417 for (std::vector<MGVertexDoFs>::iterator i=
mg_vertex_dofs.begin();
1421 if ((i->get_coarsest_level() <= level) &&
1422 (i->get_finest_level() >= level))
1423 for (
unsigned int d=0; d<this->
get_fe().dofs_per_vertex; ++d)
1424 i->set_index (level, d, new_numbers[i->get_index (level, d)]);
1426 if (this->
get_fe().dofs_per_line > 0)
1429 std::vector<bool> user_flags;
1437 for (level_cell_iterator cell =
begin(level); cell !=
end(level); ++cell)
1438 for (
unsigned int line=0; line < GeometryInfo<2>::faces_per_cell; ++line)
1439 cell->face(line)->set_user_flag();
1442 for (
unsigned int l=0; l<GeometryInfo<2>::lines_per_cell; ++l)
1443 if (cell->line(l)->user_flag_set())
1445 for (
unsigned int d=0; d<this->
get_fe().dofs_per_line; ++d)
1446 cell->line(l)->set_mg_dof_index (level, d,
1447 new_numbers[cell->line(l)->mg_dof_index(level, d)]);
1448 cell->line(l)->clear_user_flag();
1454 for (std::vector<types::global_dof_index>::iterator i=mg_levels[level]->dof_object.dofs.begin();
1455 i!=mg_levels[level]->dof_object.dofs.end(); ++i)
1459 Assert(*i<new_numbers.size(), ExcInternalError());
1460 *i = new_numbers[*i];
1469 const std::vector<types::global_dof_index> &new_numbers)
1472 ExcMessage(
"You need to distribute active and level DoFs before you can renumber level DoFs."));
1476 for (std::vector<MGVertexDoFs>::iterator i=
mg_vertex_dofs.begin();
1480 if ((i->get_coarsest_level() <= level) &&
1481 (i->get_finest_level() >= level))
1482 for (
unsigned int d=0; d<this->
get_fe().dofs_per_vertex; ++d)
1483 i->set_index (level, d, new_numbers[i->get_index (level, d)]);
1486 if (this->
get_fe().dofs_per_line > 0)
1489 std::vector<bool> user_flags;
1497 for (level_cell_iterator cell =
begin(level) ; cell !=
end(level) ; ++cell)
1498 for (
unsigned int line=0; line < GeometryInfo<3>::lines_per_cell; ++line)
1499 cell->line(line)->set_user_flag();
1503 for (
unsigned int l=0; l<GeometryInfo<3>::lines_per_cell; ++l)
1504 if (cell->line(l)->user_flag_set())
1506 for (
unsigned int d=0; d<this->
get_fe().dofs_per_line; ++d)
1507 cell->line(l)->set_mg_dof_index (level, d,
1508 new_numbers[cell->line(l)->mg_dof_index(level, d)]);
1509 cell->line(l)->clear_user_flag();
1516 if (this->
get_fe().dofs_per_quad > 0)
1519 std::vector<bool> user_flags;
1527 for (level_cell_iterator cell =
begin(level) ; cell !=
end(level); ++cell)
1528 for (
unsigned int quad=0; quad < GeometryInfo<3>::faces_per_cell; ++quad)
1529 cell->face(quad)->set_user_flag();
1532 for (
unsigned int q=0; q<GeometryInfo<3>::quads_per_cell; ++q)
1533 if (cell->quad(q)->user_flag_set())
1535 for (
unsigned int d=0; d<this->
get_fe().dofs_per_quad; ++d)
1536 cell->quad(q)->set_mg_dof_index (level, d,
1537 new_numbers[cell->quad(q)->mg_dof_index(level, d)]);
1538 cell->quad(q)->clear_user_flag();
1545 for (std::vector<types::global_dof_index>::iterator i=mg_levels[level]->dof_object.dofs.begin();
1546 i!=mg_levels[level]->dof_object.dofs.end(); ++i)
1550 Assert(*i<new_numbers.size(), ExcInternalError());
1551 *i = new_numbers[*i];
1559 template <
int dim,
int spacedim>
1568 template <
int dim,
int spacedim>
1575 return get_fe().dofs_per_vertex;
1577 return (3*
get_fe().dofs_per_vertex +
1578 2*
get_fe().dofs_per_line);
1596 return (19*
get_fe().dofs_per_vertex +
1597 28*
get_fe().dofs_per_line +
1598 8*
get_fe().dofs_per_quad);
1600 Assert (
false, ExcNotImplemented());
1607 template<
int dim,
int spacedim>
1610 for (
unsigned int i=0; i<
levels.size(); ++i)
1617 std::vector<types::global_dof_index> tmp;
1623 template<
int dim,
int spacedim>
1624 template<
int structdim>
1627 const unsigned int obj_level,
1628 const unsigned int obj_index,
1629 const unsigned int fe_index,
1630 const unsigned int local_index)
const 1632 return internal::DoFHandler::Implementation::get_dof_index (*
this, *this->mg_levels[obj_level],
1633 *this->mg_faces, obj_index,
1634 fe_index, local_index,
1638 template<
int dim,
int spacedim>
1639 template<
int structdim>
1642 internal::DoFHandler::Implementation::set_dof_index (*
this, *this->mg_levels[obj_level], *this->mg_faces, obj_index, fe_index, local_index, global_index,
internal::int2type<structdim> ());
1646 template<
int dim,
int spacedim>
1652 template<
int dim,
int spacedim>
1659 template<
int dim,
int spacedim>
1681 const unsigned int n_indices = n_levels * dofs_per_vertex;
1686 for (
unsigned int i = 0; i < n_indices; ++i)
1692 for (
unsigned int i = 0; i < n_levels; ++i)
1696 template<
int dim,
int spacedim>
1702 template<
int dim,
int spacedim>
1710 #include "dof_handler.inst" 1713 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
unsigned int get_coarsest_level() const
std::vector< MGVertexDoFs > mg_vertex_dofs
level_cell_iterator end_mg() const
static const unsigned int invalid_unsigned_int
cell_iterator begin(const unsigned int level=0) const
::FunctionMap< dim >::type FunctionMap
std::vector<::internal::DoFHandler::NumberCache > mg_number_cache
types::global_dof_index * indices
::ExceptionBase & ExcMessage(std::string arg1)
cell_iterator end() const
const unsigned int dofs_per_quad
SmartPointer< const FiniteElement< dim, spacedim >, DoFHandler< dim, spacedim > > selected_fe
IteratorRange< level_cell_iterator > mg_cell_iterators_on_level(const unsigned int level) const
std::vector<::internal::DoFHandler::DoFLevel< dim > * > levels
ActiveSelector::active_cell_iterator active_cell_iterator
SmartPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
#define AssertThrow(cond, exc)
virtual std::size_t memory_consumption() const
::internal::DoFHandler::NumberCache number_cache
void initialize(const Triangulation< dim, spacedim > &tria, const FiniteElement< dim, spacedim > &fe)
const FiniteElement< dim, spacedim > & get_fe() const
const unsigned int dofs_per_line
virtual void distribute_mg_dofs(const FiniteElement< dim, spacedim > &fe)
active_cell_iterator begin_active(const unsigned int level=0) const
BlockInfo block_info_object
unsigned int n_locally_owned_dofs() const
unsigned int finest_level
ActiveSelector::cell_iterator cell_iterator
unsigned int global_dof_index
types::global_dof_index * indices_offset
const unsigned int dofs_per_hex
#define Assert(cond, exc)
IteratorRange< active_cell_iterator > active_cell_iterators() const
void set_dof_index(const ::DoFHandler< dh_dim, spacedim > &dof_handler, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index, const types::global_dof_index global_index)
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
level_cell_iterator begin_mg(const unsigned int level=0) const
::internal::DoFHandler::DoFFaces< dim > * faces
internal::DoFHandler::DoFObjects< 1 > lines
DoFObjects< dim > dof_object
unsigned int get_finest_level() const
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
virtual unsigned int n_global_levels() const
void initialize(const DoFHandler< dim, spacedim > &, bool levels_only=false, bool active_only=false)
Fill the object with values describing block structure of the DoFHandler.
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
void initialize_local_block_info()
static unsigned int max_couplings_between_dofs(const DoFHandler< 1, spacedim > &dof_handler)
internal::DoFHandler::DoFObjects< 1 > lines
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
void initialize_local(const DoFHandler< dim, spacedim > &)
Initialize block structure on cells and compute renumbering between cell dofs and block cell dofs...
IteratorRange< level_cell_iterator > mg_cell_iterators() const
unsigned int coarsest_level
internal::DoFHandler::DoFObjects< 2 > quads
void init(const unsigned int coarsest_level, const unsigned int finest_level, const unsigned int dofs_per_vertex)
virtual void distribute_dofs(const FiniteElement< dim, spacedim > &fe)
types::global_dof_index get_dof_index(const ::DoFHandler< dh_dim, spacedim > &dof_handler, const unsigned int obj_index, const unsigned int fe_index, const unsigned int local_index) const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
const Triangulation< dim, spacedim > & get_triangulation() const
Iterator points to a valid object.
const unsigned int dofs_per_vertex
const types::boundary_id internal_face_boundary_id
types::global_dof_index n_global_dofs
unsigned int max_couplings_between_boundary_dofs() const
IteratorState::IteratorStates state() const
static void reserve_space(DoFHandler< 1, spacedim > &dof_handler)
IteratorRange< cell_iterator > cell_iterators() const
std::vector< types::global_dof_index > vertex_dofs