16 #include <deal.II/base/memory_consumption.h> 17 #include <deal.II/base/geometry_info.h> 18 #include <deal.II/base/std_cxx14/memory.h> 19 #include <deal.II/base/thread_management.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/dofs/dof_handler_policy.h> 25 #include <deal.II/grid/grid_tools.h> 26 #include <deal.II/grid/tria_accessor.h> 27 #include <deal.II/grid/tria_iterator.h> 28 #include <deal.II/grid/tria_levels.h> 29 #include <deal.II/grid/tria.h> 30 #include <deal.II/fe/fe.h> 31 #include <deal.II/distributed/shared_tria.h> 32 #include <deal.II/distributed/tria.h> 34 #include <boost/serialization/array.hpp> 40 DEAL_II_NAMESPACE_OPEN
45 #if defined(_MSC_VER) && (_MSC_VER >= 1800) 49 #define HpDoFHandler DoFHandler 67 namespace DoFHandlerImplementation
71 using ::hp::DoFHandler;
83 template <
int dim,
int spacedim>
91 std::vector<std::vector<DoFLevel::active_fe_index_type> >
92 active_fe_backup(dof_handler.
levels.size ());
93 for (
unsigned int level = 0; level<dof_handler.
levels.size (); ++level)
94 active_fe_backup[level] = std::move(dof_handler.
levels[level]->active_fe_indices);
100 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
103 dof_handler.
levels[level]->active_fe_indices = std::move(active_fe_backup[level]);
107 dof_handler.
faces = std_cxx14::make_unique<internal::hp::DoFIndicesOnFaces<dim>> ();
117 template <
int dim,
int spacedim>
134 std::vector<bool> locally_used_vertices (dof_handler.
tria->n_vertices(),
136 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
138 if (! cell->is_artificial())
139 for (
unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
140 locally_used_vertices[cell->vertex_index(v)] =
true;
142 std::vector<std::vector<bool> >
144 std::vector<bool> (dof_handler.
tria->n_vertices(),
false));
146 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
148 if (! cell->is_artificial())
149 for (
unsigned int v=0; v<GeometryInfo<dim>::vertices_per_cell; ++v)
150 vertex_fe_association[cell->active_fe_index()][cell->vertex_index(v)]
159 for (
unsigned int v=0; v<dof_handler.
tria->n_vertices(); ++v)
160 if (locally_used_vertices[v] ==
true)
161 if (dof_handler.
tria->vertex_used(v) ==
true)
165 if (vertex_fe_association[fe][v] ==
true)
176 dof_handler.vertex_dof_offsets.resize (dof_handler.
tria->n_vertices(),
179 unsigned int vertex_slots_needed = 0;
180 for (
unsigned int v=0; v<dof_handler.
tria->n_vertices(); ++v)
181 if (dof_handler.
tria->vertex_used(v) ==
true)
182 if (locally_used_vertices[v] ==
true)
184 dof_handler.vertex_dof_offsets[v] = vertex_slots_needed;
186 for (
unsigned int fe=0; fe<dof_handler.
fe_collection.size(); ++fe)
187 if (vertex_fe_association[fe][v] ==
true)
188 vertex_slots_needed += dof_handler.
get_fe(fe).dofs_per_vertex + 1;
191 ++vertex_slots_needed;
196 dof_handler.
vertex_dofs.resize (vertex_slots_needed,
198 for (
unsigned int v=0; v<dof_handler.
tria->n_vertices(); ++v)
199 if (dof_handler.
tria->vertex_used(v) ==
true)
200 if (locally_used_vertices[v] ==
true)
202 unsigned int current_index = dof_handler.vertex_dof_offsets[v];
203 for (
unsigned int fe=0; fe<dof_handler.
fe_collection.size(); ++fe)
204 if (vertex_fe_association[fe][v] ==
true)
209 current_index += dof_handler.
get_fe(fe).dofs_per_vertex + 1;
221 template <
int dim,
int spacedim>
234 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
236 dof_handler.
levels[level]->dof_offsets
237 = std::vector<DoFLevel::offset_type> (dof_handler.
tria->n_raw_cells(level),
239 dof_handler.
levels[level]->cell_cache_offsets
240 = std::vector<DoFLevel::offset_type> (dof_handler.
tria->n_raw_cells(level),
245 typename HpDoFHandler<dim,spacedim>::active_cell_iterator
248 for (; cell!=endc; ++cell)
249 if (!cell->has_children()
251 !cell->is_artificial())
253 dof_handler.
levels[level]->dof_offsets[cell->index()] = next_free_dof;
254 next_free_dof += cell->get_fe().template n_dofs_per_object<dim>();
256 dof_handler.
levels[level]->cell_cache_offsets[cell->index()] = cache_size;
257 cache_size += cell->get_fe().dofs_per_cell;
260 dof_handler.
levels[level]->dof_indices
261 = std::vector<types::global_dof_index> (next_free_dof,
263 dof_handler.
levels[level]->cell_dof_indices_cache
264 = std::vector<types::global_dof_index> (cache_size,
273 for (
unsigned int level=0; level<dof_handler.
tria->n_levels(); ++level)
276 typename HpDoFHandler<dim,spacedim>::active_cell_iterator
279 for (; cell!=endc; ++cell)
280 if (!cell->has_children()
282 !cell->is_artificial())
283 counter += cell->get_fe().template n_dofs_per_object<dim>();
285 Assert (dof_handler.
levels[level]->dof_indices.size() == counter,
292 unsigned int n_active_non_artificial_cells = 0;
293 for (cell=dof_handler.
begin_active(level); cell!=endc; ++cell)
294 if (!cell->has_children()
296 !cell->is_artificial())
297 ++n_active_non_artificial_cells;
299 Assert (static_cast<unsigned int>
300 (std::count (dof_handler.
levels[level]->dof_offsets.begin(),
301 dof_handler.
levels[level]->dof_offsets.end(),
304 dof_handler.
tria->n_raw_cells(level) - n_active_non_artificial_cells,
317 template <
int dim,
int spacedim>
323 std::vector<unsigned int> &face_dof_offsets
330 std::vector<types::global_dof_index> &face_dof_indices
354 std::vector<bool> saved_face_user_flags;
360 .save_user_flags_line (saved_face_user_flags);
362 .clear_user_flags_line ();
370 .save_user_flags_quad (saved_face_user_flags);
372 .clear_user_flags_quad ();
383 unsigned int n_face_slots = 0;
385 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
387 if (! cell->is_artificial())
388 for (
unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
389 if (! cell->face(face)->user_flag_set())
399 if (cell->at_boundary(face)
401 cell->face(face)->has_children()
403 cell->neighbor_is_coarser(face)
405 (!cell->at_boundary(face)
407 cell->neighbor(face)->is_artificial())
409 (!cell->at_boundary(face)
411 !cell->neighbor(face)->is_artificial()
413 (cell->active_fe_index() == cell->neighbor(face)->active_fe_index())))
417 += 1 + dof_handler.
get_fe(cell->active_fe_index()).
template n_dofs_per_object<dim-1>() + 1;
425 dof_handler.
get_fe(cell->active_fe_index()).
template n_dofs_per_object<dim-1>()
427 dof_handler.
get_fe(cell->neighbor(face)->active_fe_index())
428 .
template n_dofs_per_object<dim-1>()
433 cell->face(face)->set_user_flag ();
441 = std::vector<unsigned int> (dof_handler.
tria->n_raw_faces(),
444 = std::vector<types::global_dof_index> (n_face_slots,
455 .clear_user_flags_line ();
463 .clear_user_flags_quad ();
472 unsigned int next_free_face_slot = 0;
474 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
476 if (! cell->is_artificial())
477 for (
unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
478 if (! cell->face(face)->user_flag_set())
481 if (cell->at_boundary(face)
483 cell->face(face)->has_children()
485 cell->neighbor_is_coarser(face)
487 (!cell->at_boundary(face)
489 cell->neighbor(face)->is_artificial())
491 (!cell->at_boundary(face)
493 !cell->neighbor(face)->is_artificial()
495 (cell->active_fe_index() == cell->neighbor(face)->active_fe_index())))
497 face_dof_offsets[cell->face(face)->index()]
498 = next_free_face_slot;
502 face_dof_indices[next_free_face_slot]
503 = cell->active_fe_index();
513 += dof_handler.
get_fe(cell->active_fe_index()).
template n_dofs_per_object<dim-1>() + 2;
517 face_dof_offsets[cell->face(face)->index()]
518 = next_free_face_slot;
522 face_dof_indices[next_free_face_slot]
523 = cell->active_fe_index();
530 face_dof_indices[next_free_face_slot
532 dof_handler.
get_fe(cell->active_fe_index()).
template n_dofs_per_object<dim-1>()
535 = cell->neighbor(face)->active_fe_index();
545 += (dof_handler.
get_fe(cell->active_fe_index()).
template n_dofs_per_object<dim-1>()
547 dof_handler.
get_fe(cell->neighbor(face)->active_fe_index())
548 .
template n_dofs_per_object<dim-1>()
554 cell->face(face)->set_user_flag ();
559 Assert (next_free_face_slot == n_face_slots,
568 .load_user_flags_line (saved_face_user_flags);
576 .load_user_flags_quad (saved_face_user_flags);
595 template <
int spacedim>
603 ExcMessage(
"The current Triangulation must not be empty."));
615 template <
int spacedim>
623 ExcMessage(
"The current Triangulation must not be empty."));
639 template <
int spacedim>
644 const unsigned int dim = 3;
649 ExcMessage(
"The current Triangulation must not be empty."));
674 std::vector<std::vector<bool> >
676 std::vector<bool> (dof_handler.
tria->n_raw_lines(),
679 for (
typename HpDoFHandler<dim,spacedim>::active_cell_iterator
681 cell!=dof_handler.
end(); ++cell)
682 for (
unsigned int l=0; l<GeometryInfo<dim>::lines_per_cell; ++l)
683 line_fe_association[cell->active_fe_index()][cell->line_index(l)]
690 std::vector<bool> line_is_used (dof_handler.
tria->n_raw_lines(),
false);
691 for (
unsigned int line=0; line<dof_handler.
tria->n_raw_lines(); ++line)
692 for (
unsigned int fe=0; fe<dof_handler.
fe_collection.size(); ++fe)
693 if (line_fe_association[fe][line] ==
true)
695 line_is_used[line] =
true;
704 dof_handler.
faces->lines.dof_offsets
705 .resize (dof_handler.
tria->n_raw_lines(),
708 unsigned int line_slots_needed = 0;
709 for (
unsigned int line=0; line<dof_handler.
tria->n_raw_lines(); ++line)
710 if (line_is_used[line] ==
true)
712 dof_handler.
faces->lines.dof_offsets[line] = line_slots_needed;
714 for (
unsigned int fe=0; fe<dof_handler.
fe_collection.size(); ++fe)
715 if (line_fe_association[fe][line] ==
true)
716 line_slots_needed += dof_handler.
get_fe(fe).dofs_per_line + 1;
722 dof_handler.
faces->lines.dofs.resize (line_slots_needed,
724 for (
unsigned int line=0; line<dof_handler.
tria->n_raw_lines(); ++line)
725 if (line_is_used[line] ==
true)
727 unsigned int pointer = dof_handler.
faces->lines.dof_offsets[line];
728 for (
unsigned int fe=0; fe<dof_handler.
fe_collection.size(); ++fe)
729 if (line_fe_association[fe][line] ==
true)
733 dof_handler.
faces->lines.dofs[pointer] = fe;
734 pointer += dof_handler.
get_fe(fe).dofs_per_line + 1;
750 template <
int spacedim>
755 return std::min(static_cast<types::global_dof_index> (3*
763 template <
int spacedim>
788 switch (dof_handler.
tria->max_adjacent_cells())
791 max_couplings=19*dof_handler.
fe_collection.max_dofs_per_vertex() +
796 max_couplings=21*dof_handler.
fe_collection.max_dofs_per_vertex() +
801 max_couplings=28*dof_handler.
fe_collection.max_dofs_per_vertex() +
806 max_couplings=30*dof_handler.
fe_collection.max_dofs_per_vertex() +
811 max_couplings=37*dof_handler.
fe_collection.max_dofs_per_vertex() +
819 return std::min(max_couplings,dof_handler.
n_dofs());
823 template <
int spacedim>
836 const unsigned int max_adjacent_cells = dof_handler.
tria->max_adjacent_cells();
839 if (max_adjacent_cells <= 8)
840 max_couplings=7*7*7*dof_handler.
fe_collection.max_dofs_per_vertex() +
850 return std::min(max_couplings,dof_handler.
n_dofs());
859 template <
int dim,
int spacedim>
876 std::vector<unsigned int> active_fe_indices (tr->n_active_cells(),
879 if (cell->is_locally_owned())
880 active_fe_indices[cell->active_cell_index()] = cell->active_fe_index();
883 tr->get_communicator(),
893 if (cell->is_ghost())
894 dof_handler.
levels[cell->level()]->
895 set_active_fe_index(cell->index(),
896 active_fe_indices[cell->active_cell_index()]);
907 = [] (
const typename ::hp::DoFHandler<dim,spacedim>::active_cell_iterator &cell) ->
unsigned int 909 return cell->active_fe_index();
913 = [&dof_handler] (
const typename ::hp::DoFHandler<dim,spacedim>::active_cell_iterator &cell,
914 const unsigned int &active_fe_index) ->
void 920 dof_handler.
levels[cell->level()]->
921 set_active_fe_index(cell->index(),
925 GridTools::exchange_cell_data_to_ghosts<unsigned int, ::hp::DoFHandler<dim,spacedim>>
926 (dof_handler, pack, unpack);
944 template <
int dim,
int spacedim>
947 template <
int dim,
int spacedim>
950 template <
int dim,
int spacedim>
955 template <
int dim,
int spacedim>
958 tria(nullptr, typeid(*this).name()),
963 template <
int dim,
int spacedim>
966 tria(&tria, typeid(*this).name()),
969 setup_policy_and_listeners ();
971 create_active_fe_table ();
975 template <
int dim,
int spacedim>
980 for (
unsigned int i=0; i<tria_listeners.size(); ++i)
981 tria_listeners[i].disconnect ();
982 tria_listeners.clear ();
994 template <
int dim,
int spacedim>
998 return cell_iterator (*this->get_triangulation().begin(level),
1004 template <
int dim,
int spacedim>
1012 while (i->has_children())
1020 template <
int dim,
int spacedim>
1031 template <
int dim,
int spacedim>
1035 return (level == this->get_triangulation().n_levels()-1 ?
1041 template <
int dim,
int spacedim>
1045 return (level == this->get_triangulation().n_levels()-1 ?
1047 begin_active (level+1));
1052 template <
int dim,
int spacedim>
1062 template <
int dim,
int spacedim>
1068 (begin_active(), end());
1073 template <
int dim,
int spacedim>
1079 (begin(level), end(level));
1084 template <
int dim,
int spacedim>
1090 (begin_active(level), end_active(level));
1099 template <
int dim,
int spacedim>
1104 std::set<types::global_dof_index> boundary_dofs;
1105 std::vector<types::global_dof_index> dofs_on_face;
1113 typename HpDoFHandler<dim,spacedim>::active_cell_iterator cell = this->begin_active (),
1115 for (; cell!=endc; ++cell)
1116 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
1117 if (cell->at_boundary(f))
1119 const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
1120 dofs_on_face.resize (dofs_per_face);
1122 cell->face(f)->get_dof_indices (dofs_on_face,
1123 cell->active_fe_index());
1124 for (
unsigned int i=0; i<dofs_per_face; ++i)
1125 boundary_dofs.insert(dofs_on_face[i]);
1127 return boundary_dofs.size();
1132 template <
int dim,
int spacedim>
1142 std::set<types::global_dof_index> boundary_dofs;
1143 std::vector<types::global_dof_index> dofs_on_face;
1146 typename HpDoFHandler<dim,spacedim>::active_cell_iterator cell = this->begin_active (),
1148 for (; cell!=endc; ++cell)
1149 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
1150 if (cell->at_boundary(f) &&
1151 (boundary_ids.find(cell->face(f)->boundary_id()) !=
1152 boundary_ids.end()))
1154 const unsigned int dofs_per_face = cell->get_fe().dofs_per_face;
1155 dofs_on_face.resize (dofs_per_face);
1157 cell->face(f)->get_dof_indices (dofs_on_face,
1158 cell->active_fe_index());
1159 for (
unsigned int i=0; i<dofs_per_face; ++i)
1160 boundary_dofs.insert(dofs_on_face[i]);
1162 return boundary_dofs.size();
1177 template <
typename number>
1195 template <
int dim,
int spacedim>
1208 for (
unsigned int i=0; i<levels.size(); ++i)
1220 template <
int dim,
int spacedim>
1223 Assert(active_fe_indices.size()==get_triangulation().n_active_cells(),
1226 create_active_fe_table ();
1233 for (
unsigned int i=0; cell!=endc; ++cell, ++i)
1234 if (cell->is_locally_owned())
1235 cell->set_active_fe_index(active_fe_indices[i]);
1240 template <
int dim,
int spacedim>
1243 active_fe_indices.resize(get_triangulation().n_active_cells());
1250 for (
unsigned int i=0; cell!=endc; ++cell, ++i)
1251 active_fe_indices[i] = cell->active_fe_index();
1254 template <
int dim,
int spacedim>
1258 if (this->tria != &tria)
1260 for (
unsigned int i=0; i<tria_listeners.size(); ++i)
1261 tria_listeners[i].disconnect ();
1262 tria_listeners.clear ();
1266 setup_policy_and_listeners ();
1269 create_active_fe_table ();
1271 distribute_dofs (fe);
1275 template <
int dim,
int spacedim>
1279 ExcMessage(
"You need to set the Triangulation in the DoFHandler using initialize() or " 1280 "in the constructor before you can distribute DoFs."));
1281 Assert (tria->n_levels() > 0,
1282 ExcMessage(
"The Triangulation you are using is empty!"));
1284 ExcMessage(
"The hp::FECollection given is empty!"));
1287 if (fe_collection != ff)
1298 std::vector<types::subdomain_id> saved_subdomain_ids;
1301 if (shared_tria->with_artificial_cells())
1303 saved_subdomain_ids.resize (shared_tria->n_active_cells());
1305 typename parallel::shared::Triangulation<dim,spacedim>::active_cell_iterator
1306 cell = get_triangulation().begin_active(),
1307 endc = get_triangulation().end();
1309 const std::vector<types::subdomain_id> &true_subdomain_ids
1310 = shared_tria->get_true_subdomain_ids_of_cells();
1312 for (
unsigned int index=0; cell != endc; ++cell, ++index)
1314 saved_subdomain_ids[index] = cell->subdomain_id();
1315 cell->set_subdomain_id(true_subdomain_ids[index]);
1321 create_active_fe_table ();
1326 if (cell->is_locally_owned())
1327 Assert (cell->active_fe_index() < fe_collection.size(),
1328 ExcInvalidFEIndex (cell->active_fe_index(),
1329 fe_collection.size()));
1339 if (shared_tria->with_artificial_cells())
1341 typename parallel::shared::Triangulation<dim,spacedim>::active_cell_iterator
1342 cell = get_triangulation().begin_active(),
1343 endc = get_triangulation().end();
1345 for (
unsigned int index=0; cell != endc; ++cell, ++index)
1346 cell->set_subdomain_id(saved_subdomain_ids[index]);
1354 std::vector<bool> user_flags;
1362 number_cache = policy->distribute_dofs ();
1369 for (
int level=levels.size()-1; level>=0; --level)
1370 tg +=
Threads::new_task (&::internal::hp::DoFLevel::compress_data<dim,spacedim>,
1371 *levels[level], fe_collection);
1380 template <
int dim,
int spacedim>
1385 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::ParallelShared<DoFHandler<dim,spacedim> >> (*this);
1387 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::ParallelDistributed<DoFHandler<dim,spacedim> >> (*this);
1389 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::Sequential<DoFHandler<dim,spacedim> >> (*this);
1391 tria_listeners.push_back
1392 (this->tria->signals.pre_refinement
1395 tria_listeners.push_back
1396 (this->tria->signals.post_refinement
1399 tria_listeners.push_back
1400 (this->tria->signals.create
1406 template <
int dim,
int spacedim>
1415 template <
int dim,
int spacedim>
1418 Assert(levels.size()>0,
ExcMessage(
"You need to distribute DoFs before you can renumber them."));
1432 if (n_locally_owned_dofs() == n_dofs())
1434 std::vector<types::global_dof_index> tmp(new_numbers);
1435 std::sort (tmp.begin(), tmp.end());
1436 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
1438 for (; p!=tmp.end(); ++p, ++i)
1439 Assert (*p == i, ExcNewNumbersNotConsecutive(i));
1443 Assert (new_numbers[i] < n_dofs(),
1444 ExcMessage (
"New DoF index is not less than the total number of dofs."));
1452 for (
int level=levels.size()-1; level>=0; --level)
1453 tg +=
Threads::new_task (&::internal::hp::DoFLevel::uncompress_data<dim,spacedim>,
1454 *levels[level], fe_collection);
1459 number_cache = policy->renumber_dofs(new_numbers);
1464 for (
int level=levels.size()-1; level>=0; --level)
1465 tg +=
Threads::new_task (&::internal::hp::DoFLevel::compress_data<dim,spacedim>,
1466 *levels[level], fe_collection);
1473 template <
int dim,
int spacedim>
1478 return ::internal::hp::DoFHandlerImplementation::Implementation::max_couplings_between_dofs (*
this);
1483 template <
int dim,
int spacedim>
1492 return fe_collection.max_dofs_per_vertex();
1494 return (3*fe_collection.max_dofs_per_vertex()
1496 2*fe_collection.max_dofs_per_line());
1507 return (19*fe_collection.max_dofs_per_vertex() +
1508 28*fe_collection.max_dofs_per_line() +
1509 8*fe_collection.max_dofs_per_quad());
1518 template <
int dim,
int spacedim>
1522 while (levels.size () < tria->n_levels ())
1523 levels.emplace_back (new ::internal::hp::DoFLevel);
1527 for (
unsigned int level=0; level<levels.size(); ++level)
1529 if (levels[level]->active_fe_indices.size () == 0)
1530 levels[level]->active_fe_indices.resize (tria->n_raw_cells(level),
1537 Assert (levels[level]->active_fe_indices.size () ==
1538 tria->n_raw_cells(level),
1548 levels[level]->normalize_active_fe_indices ();
1553 template <
int dim,
int spacedim>
1556 create_active_fe_table ();
1561 for (
unsigned int i=0; i<levels.size(); ++i)
1563 const unsigned int cells_on_level = tria->n_raw_cells(i);
1564 std::unique_ptr<std::vector<bool> > has_children_level(
new std::vector<bool> (cells_on_level));
1570 std::transform (tria->levels[i]->cells.children.begin (),
1571 tria->levels[i]->cells.children.end (),
1572 has_children_level->begin (),
1573 std::bind(std::not_equal_to<int>(),
1574 std::placeholders::_1,
1577 std::transform (tria->levels[i]->cells.refinement_cases.begin (),
1578 tria->levels[i]->cells.refinement_cases.end (),
1579 has_children_level->begin (),
1580 std::bind (std::not_equal_to<unsigned char>(),
1581 std::placeholders::_1,
1584 has_children.emplace_back (std::move(has_children_level));
1590 template <
int dim,
int spacedim>
1598 while (levels.size () < tria->n_levels ())
1599 levels.emplace_back (new ::internal::hp::DoFLevel);
1602 while (levels.size () > tria->n_levels ())
1611 for (
unsigned int i=0; i<levels.size(); ++i)
1612 levels[i]->active_fe_indices.resize (tria->n_raw_cells(i), 0);
1621 if (fe_collection.size() > 0)
1623 cell_iterator cell = begin(),
1625 for (; cell != endc; ++cell)
1640 if (cell->has_children () &&
1641 !(*has_children [cell->level ()])[cell->index ()])
1653 for (
unsigned int i = 0; i < cell->n_children(); ++i)
1654 if (cell->child (i)->is_locally_owned())
1655 cell->child (i)->set_active_fe_index
1656 (levels[cell->level()]->active_fe_index (cell->index()));
1662 has_children.clear ();
1666 template <
int dim,
int spacedim>
1667 template <
int structdim>
1672 const unsigned int)
const 1679 template <
int dim,
int spacedim>
1680 template <
int structdim>
1692 template <
int dim,
int spacedim>
1698 vertex_dofs = std::move(std::vector<types::global_dof_index>());
1699 vertex_dof_offsets = std::move (std::vector<unsigned int>());
1706 #include "dof_handler.inst" 1709 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
#define AssertDimension(dim1, dim2)
cell_iterator begin(const unsigned int level=0) const
Task< RT > new_task(const std::function< RT()> &function)
std::vector< std::unique_ptr<::internal::hp::DoFLevel > > levels
void load_user_flags(std::istream &in)
cell_iterator end() const
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > levels
unsigned int max_dofs_per_face(const DoFHandler< dim, spacedim > &dh)
SmartPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
unsigned int size() const
virtual std::size_t memory_consumption() const
static void reserve_space_cells(DoFHandler< dim, spacedim > &dof_handler)
void initialize(const Triangulation< dim, spacedim > &tria, const FiniteElement< dim, spacedim > &fe)
ActiveSelector::active_cell_iterator active_cell_iterator
active_cell_iterator begin_active(const unsigned int level=0) const
static ::ExceptionBase & ExcMessage(std::string arg1)
T sum(const T &t, const MPI_Comm &mpi_communicator)
unsigned int global_dof_index
#define Assert(cond, exc)
IteratorRange< active_cell_iterator > active_cell_iterators() const
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
std::vector< types::global_dof_index > dofs
active_cell_iterator end_active(const unsigned int level) const
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
types::global_dof_index n_boundary_dofs() const
static void reserve_space_release_space(DoFHandler< dim, spacedim > &dof_handler)
types::global_dof_index n_dofs() const
ActiveSelector::cell_iterator cell_iterator
static unsigned int max_couplings_between_dofs(const DoFHandler< 1, spacedim > &dof_handler)
std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces< dim > > faces
std::vector< unsigned int > dof_offsets
internal::hp::DoFIndicesOnFacesOrEdges< 2 > quads
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
const Triangulation< dim, spacedim > & get_triangulation() const
virtual void distribute_dofs(const FiniteElement< dim, spacedim > &fe)
static void reserve_space_vertices(DoFHandler< dim, spacedim > &dof_handler)
void save_user_flags(std::ostream &out) const
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 types::boundary_id internal_face_boundary_id
unsigned int max_couplings_between_boundary_dofs() const
static void communicate_active_fe_indices(::hp::DoFHandler< dim, spacedim > &dof_handler)
static void reserve_space(DoFHandler< 1, spacedim > &dof_handler)
const types::global_dof_index invalid_dof_index
static ::ExceptionBase & ExcNoFESelected()
IteratorRange< cell_iterator > cell_iterators() const
static void reserve_space_faces(DoFHandler< dim, spacedim > &dof_handler)
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
std::vector< types::global_dof_index > vertex_dofs
static ::ExceptionBase & ExcInternalError()
hp::FECollection< dim, spacedim > fe_collection