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> 30 #include <deal.II/base/std_cxx14/memory.h> 35 DEAL_II_NAMESPACE_OPEN
38 template <
int dim,
int spacedim>
41 template <
int dim,
int spacedim>
44 template <
int dim,
int spacedim>
47 template <
int dim,
int spacedim>
55 template <
int dim,
int spacedim>
58 return &::numbers::invalid_dof_index;
66 template <
int dim,
int spacedim>
67 std::string policy_to_string(const ::internal::DoFHandlerImplementation::Policy::PolicyBase<dim,spacedim> &policy)
69 std::string policy_name;
70 if (
dynamic_cast<const typename ::internal::DoFHandlerImplementation::Policy::Sequential<::DoFHandler<dim,spacedim>
>*>(&policy)
71 ||
dynamic_cast<const typename ::internal::DoFHandlerImplementation::Policy::Sequential<::hp::DoFHandler<dim,spacedim>
>*>(&policy))
72 policy_name =
"Policy::Sequential<";
73 else if (
dynamic_cast<const typename ::internal::DoFHandlerImplementation::Policy::ParallelDistributed<::DoFHandler<dim,spacedim>
>*>(&policy)
74 ||
dynamic_cast<const typename ::internal::DoFHandlerImplementation::Policy::ParallelDistributed<::hp::DoFHandler<dim,spacedim>
>*>(&policy))
75 policy_name =
"Policy::ParallelDistributed<";
76 else if (
dynamic_cast<const typename ::internal::DoFHandlerImplementation::Policy::ParallelShared<::DoFHandler<dim,spacedim>
>*>(&policy)
77 ||
dynamic_cast<const typename ::internal::DoFHandlerImplementation::Policy::ParallelShared<::hp::DoFHandler<dim,spacedim>
>*>(&policy))
78 policy_name =
"Policy::ParallelShared<";
87 namespace DoFHandlerImplementation
105 template <
int spacedim>
110 return std::min(static_cast<types::global_dof_index>(3*dof_handler.
get_fe().dofs_per_vertex +
111 2*dof_handler.
get_fe().dofs_per_line),
117 template <
int spacedim>
145 switch (dof_handler.
tria->max_adjacent_cells())
148 max_couplings=19*dof_handler.
get_fe().dofs_per_vertex +
149 28*dof_handler.
get_fe().dofs_per_line +
150 8*dof_handler.
get_fe().dofs_per_quad;
153 max_couplings=21*dof_handler.
get_fe().dofs_per_vertex +
154 31*dof_handler.
get_fe().dofs_per_line +
155 9*dof_handler.
get_fe().dofs_per_quad;
158 max_couplings=28*dof_handler.
get_fe().dofs_per_vertex +
159 42*dof_handler.
get_fe().dofs_per_line +
160 12*dof_handler.
get_fe().dofs_per_quad;
163 max_couplings=30*dof_handler.
get_fe().dofs_per_vertex +
164 45*dof_handler.
get_fe().dofs_per_line +
165 13*dof_handler.
get_fe().dofs_per_quad;
168 max_couplings=37*dof_handler.
get_fe().dofs_per_vertex +
169 56*dof_handler.
get_fe().dofs_per_line +
170 16*dof_handler.
get_fe().dofs_per_quad;
178 max_couplings=39*dof_handler.
get_fe().dofs_per_vertex +
179 59*dof_handler.
get_fe().dofs_per_line +
180 17*dof_handler.
get_fe().dofs_per_quad;
183 max_couplings=46*dof_handler.
get_fe().dofs_per_vertex +
184 70*dof_handler.
get_fe().dofs_per_line +
185 20*dof_handler.
get_fe().dofs_per_quad;
188 max_couplings=48*dof_handler.
get_fe().dofs_per_vertex +
189 73*dof_handler.
get_fe().dofs_per_line +
190 21*dof_handler.
get_fe().dofs_per_quad;
193 max_couplings=55*dof_handler.
get_fe().dofs_per_vertex +
194 84*dof_handler.
get_fe().dofs_per_line +
195 24*dof_handler.
get_fe().dofs_per_quad;
198 max_couplings=57*dof_handler.
get_fe().dofs_per_vertex +
199 87*dof_handler.
get_fe().dofs_per_line +
200 25*dof_handler.
get_fe().dofs_per_quad;
203 max_couplings=63*dof_handler.
get_fe().dofs_per_vertex +
204 98*dof_handler.
get_fe().dofs_per_line +
205 28*dof_handler.
get_fe().dofs_per_quad;
208 max_couplings=65*dof_handler.
get_fe().dofs_per_vertex +
209 103*dof_handler.
get_fe().dofs_per_line +
210 29*dof_handler.
get_fe().dofs_per_quad;
213 max_couplings=72*dof_handler.
get_fe().dofs_per_vertex +
214 114*dof_handler.
get_fe().dofs_per_line +
215 32*dof_handler.
get_fe().dofs_per_quad;
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.
get_fe().dofs_per_vertex +
250 7*6*7*3*dof_handler.
get_fe().dofs_per_line +
251 9*4*7*3*dof_handler.
get_fe().dofs_per_quad +
252 27*dof_handler.
get_fe().dofs_per_hex;
259 return std::min(max_couplings,dof_handler.
n_dofs());
272 template <
int spacedim>
277 .resize(dof_handler.
tria->n_vertices() *
278 dof_handler.
get_fe().dofs_per_vertex,
281 for (
unsigned int i=0; i<dof_handler.
tria->n_levels(); ++i)
285 dof_handler.
levels.back()->dof_object.dofs
286 .resize (dof_handler.
tria->n_raw_cells(i) *
287 dof_handler.
get_fe().dofs_per_line,
290 dof_handler.
levels.back()->cell_dof_indices_cache
291 .resize (dof_handler.
tria->n_raw_cells(i) *
292 dof_handler.
get_fe().dofs_per_cell,
298 template <
int spacedim>
303 .resize(dof_handler.
tria->n_vertices() *
304 dof_handler.
get_fe().dofs_per_vertex,
307 for (
unsigned int i=0; i<dof_handler.
tria->n_levels(); ++i)
311 dof_handler.
levels.back()->dof_object.dofs
312 .resize (dof_handler.
tria->n_raw_cells(i) *
313 dof_handler.
get_fe().dofs_per_quad,
316 dof_handler.
levels.back()->cell_dof_indices_cache
317 .resize (dof_handler.
tria->n_raw_cells(i) *
318 dof_handler.
get_fe().dofs_per_cell,
322 dof_handler.
faces = std_cxx14::make_unique<internal::DoFHandlerImplementation::DoFFaces<2>> ();
324 if (dof_handler.
tria->n_cells() > 0)
326 dof_handler.
faces->lines.dofs
327 .resize (dof_handler.
tria->n_raw_lines() *
328 dof_handler.
get_fe().dofs_per_line,
334 template <
int spacedim>
339 .resize(dof_handler.
tria->n_vertices() *
340 dof_handler.
get_fe().dofs_per_vertex,
343 for (
unsigned int i=0; i<dof_handler.
tria->n_levels(); ++i)
347 dof_handler.
levels.back()->dof_object.dofs
348 .resize (dof_handler.
tria->n_raw_cells(i) *
349 dof_handler.
get_fe().dofs_per_hex,
352 dof_handler.
levels.back()->cell_dof_indices_cache
353 .resize (dof_handler.
tria->n_raw_cells(i) *
354 dof_handler.
get_fe().dofs_per_cell,
357 dof_handler.
faces = std_cxx14::make_unique<internal::DoFHandlerImplementation::DoFFaces<3>> ();
360 if (dof_handler.
tria->n_cells() > 0)
362 dof_handler.
faces->lines.dofs
363 .resize (dof_handler.
tria->n_raw_lines() *
364 dof_handler.
get_fe().dofs_per_line,
366 dof_handler.
faces->quads.dofs
367 .resize (dof_handler.
tria->n_raw_quads() *
368 dof_handler.
get_fe().dofs_per_quad,
373 template <
int spacedim>
381 const unsigned int &dofs_per_line = dof_handler.
get_fe ().dofs_per_line;
382 const unsigned int &n_levels = tria.n_levels ();
384 for (
unsigned int i = 0; i < n_levels; ++i)
387 dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_lines (i) * dofs_per_line,
numbers::invalid_dof_index);
390 const unsigned int &n_vertices = tria.n_vertices ();
394 std::vector<unsigned int> max_level (n_vertices, 0);
395 std::vector<unsigned int> min_level (n_vertices, n_levels);
397 for (typename ::Triangulation<1, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell)
399 const unsigned int level = cell->level ();
401 for (
unsigned int vertex = 0; vertex < GeometryInfo<1>::vertices_per_cell; ++vertex)
403 const unsigned int vertex_index = cell->vertex_index (vertex);
405 if (min_level[vertex_index] > level)
406 min_level[vertex_index] = level;
408 if (max_level[vertex_index] < level)
409 max_level[vertex_index] = level;
413 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
414 if (tria.vertex_used (vertex))
418 dof_handler.
mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], dof_handler.
get_fe ().dofs_per_vertex);
429 template <
int spacedim>
436 const ::FiniteElement<2, spacedim> &fe = dof_handler.
get_fe ();
438 const unsigned int &n_levels = tria.n_levels ();
440 for (
unsigned int i = 0; i < n_levels; ++i)
443 dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_quads (i) * fe.dofs_per_quad,
numbers::invalid_dof_index);
446 dof_handler.mg_faces = std_cxx14::make_unique<internal::DoFHandlerImplementation::DoFFaces<2>> ();
447 dof_handler.mg_faces->lines.dofs = std::vector<types::global_dof_index> (tria.n_raw_lines () * fe.dofs_per_line,
numbers::invalid_dof_index);
449 const unsigned int &n_vertices = tria.n_vertices ();
453 std::vector<unsigned int> max_level (n_vertices, 0);
454 std::vector<unsigned int> min_level (n_vertices, n_levels);
456 for (typename ::Triangulation<2, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell)
458 const unsigned int level = cell->level ();
460 for (
unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex)
462 const unsigned int vertex_index = cell->vertex_index (vertex);
464 if (min_level[vertex_index] > level)
465 min_level[vertex_index] = level;
467 if (max_level[vertex_index] < level)
468 max_level[vertex_index] = level;
472 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
473 if (tria.vertex_used (vertex))
477 dof_handler.
mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], fe.dofs_per_vertex);
488 template <
int spacedim>
495 const ::FiniteElement<3, spacedim> &fe = dof_handler.
get_fe ();
497 const unsigned int &n_levels = tria.n_levels ();
499 for (
unsigned int i = 0; i < n_levels; ++i)
502 dof_handler.mg_levels.back ()->dof_object.dofs = std::vector<types::global_dof_index> (tria.n_raw_hexs (i) * fe.dofs_per_hex,
numbers::invalid_dof_index);
505 dof_handler.mg_faces = std_cxx14::make_unique<internal::DoFHandlerImplementation::DoFFaces<3>> ();
506 dof_handler.mg_faces->lines.dofs = std::vector<types::global_dof_index> (tria.n_raw_lines () * fe.dofs_per_line,
numbers::invalid_dof_index);
507 dof_handler.mg_faces->quads.dofs = std::vector<types::global_dof_index> (tria.n_raw_quads () * fe.dofs_per_quad,
numbers::invalid_dof_index);
509 const unsigned int &n_vertices = tria.n_vertices ();
513 std::vector<unsigned int> max_level (n_vertices, 0);
514 std::vector<unsigned int> min_level (n_vertices, n_levels);
516 for (typename ::Triangulation<3, spacedim>::cell_iterator cell = tria.begin (); cell != tria.end (); ++cell)
518 const unsigned int level = cell->level ();
520 for (
unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex)
522 const unsigned int vertex_index = cell->vertex_index (vertex);
524 if (min_level[vertex_index] > level)
525 min_level[vertex_index] = level;
527 if (max_level[vertex_index] < level)
528 max_level[vertex_index] = level;
532 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
533 if (tria.vertex_used (vertex))
537 dof_handler.
mg_vertex_dofs[vertex].init (min_level[vertex], max_level[vertex], fe.dofs_per_vertex);
550 template <
int spacedim>
557 const unsigned int obj_index,
558 const unsigned int fe_index,
559 const unsigned int local_index,
560 const std::integral_constant<int, 1>)
562 return mg_level->dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
565 template <
int spacedim>
570 return mg_faces->lines.get_dof_index (dof_handler, obj_index, fe_index, local_index);
573 template <
int spacedim>
578 return mg_level->dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
581 template <
int spacedim>
586 return mg_faces->lines.get_dof_index (dof_handler, obj_index, fe_index, local_index);
589 template <
int spacedim>
594 return mg_faces->quads.get_dof_index (dof_handler, obj_index, fe_index, local_index);
597 template <
int spacedim>
602 return mg_level->dof_object.get_dof_index (dof_handler, obj_index, fe_index, local_index);
605 template <
int spacedim>
609 mg_level->dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
612 template <
int spacedim>
616 mg_faces->lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
619 template <
int spacedim>
623 mg_level->dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
626 template <
int spacedim>
630 mg_faces->lines.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
633 template <
int spacedim>
637 mg_faces->quads.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
640 template <
int spacedim>
644 mg_level->dof_object.set_dof_index (dof_handler, obj_index, fe_index, local_index, global_index);
652 template <
int dim,
int spacedim>
655 tria(&tria, typeid(*this).name()),
663 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::ParallelShared<DoFHandler<dim,spacedim> >> (*this);
667 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::Sequential<DoFHandler<dim,spacedim> >> (*this);
669 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::ParallelDistributed<DoFHandler<dim,spacedim> >> (*this);
673 template <
int dim,
int spacedim>
676 tria(nullptr, typeid(*this).name())
680 template <
int dim,
int spacedim>
696 template <
int dim,
int spacedim>
704 number_cache.n_global_dofs = 0;
708 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::ParallelShared<DoFHandler<dim,spacedim> >> (*this);
710 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::ParallelDistributed<DoFHandler<dim,spacedim> >> (*this);
712 policy = std_cxx14::make_unique<internal::DoFHandlerImplementation::Policy::Sequential<DoFHandler<dim,spacedim> >> (*this);
721 template <
int dim,
int spacedim>
726 if (cell == this->get_triangulation().end(level))
733 template <
int dim,
int spacedim>
741 while (i->has_children())
749 template <
int dim,
int spacedim>
760 template <
int dim,
int spacedim>
771 template <
int dim,
int spacedim>
783 template <
int dim,
int spacedim>
784 typename DoFHandler<dim, spacedim>::level_cell_iterator
790 if (cell == this->get_triangulation().end(level))
791 return end_mg(level);
792 return level_cell_iterator (*cell,
this);
796 template <
int dim,
int spacedim>
797 typename DoFHandler<dim, spacedim>::level_cell_iterator
805 return level_cell_iterator (*cell,
this);
809 template <
int dim,
int spacedim>
810 typename DoFHandler<dim, spacedim>::level_cell_iterator
813 return level_cell_iterator (&this->get_triangulation(), -1, -1,
this);
818 template <
int dim,
int spacedim>
828 template <
int dim,
int spacedim>
834 (begin_active(), end());
839 template <
int dim,
int spacedim>
845 (begin_mg(), end_mg());
851 template <
int dim,
int spacedim>
857 (begin(level), end(level));
862 template <
int dim,
int spacedim>
868 (begin_active(level), end_active(level));
873 template <
int dim,
int spacedim>
879 (begin_mg(level), end_mg(level));
888 template <
int dim,
int spacedim>
891 std::set<int> boundary_dofs;
893 const unsigned int dofs_per_face = get_fe().dofs_per_face;
894 std::vector<types::global_dof_index> dofs_on_face(dofs_per_face);
912 for (; cell!=endc; ++cell)
913 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
914 if (cell->at_boundary(f))
916 cell->face(f)->get_dof_indices (dofs_on_face);
917 for (
unsigned int i=0; i<dofs_per_face; ++i)
918 boundary_dofs.insert(dofs_on_face[i]);
921 return boundary_dofs.size();
926 template <
int dim,
int spacedim>
933 std::set<types::global_dof_index> boundary_dofs;
935 const unsigned int dofs_per_face = get_fe().dofs_per_face;
936 std::vector<types::global_dof_index> dofs_on_face(dofs_per_face);
943 for (; cell!=endc; ++cell)
944 for (
unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
945 if (cell->at_boundary(f)
947 (std::find (boundary_ids.begin(),
949 cell->face(f)->boundary_id()) !=
952 cell->face(f)->get_dof_indices (dofs_on_face);
953 for (
unsigned int i=0; i<dofs_per_face; ++i)
954 boundary_dofs.insert(dofs_on_face[i]);
957 return boundary_dofs.size();
962 template <
int dim,
int spacedim>
972 sizeof (number_cache) +
975 for (
unsigned int i=0; i<levels.size(); ++i)
978 for (
unsigned int level = 0; level < mg_levels.size (); ++level)
979 mem += mg_levels[level]->memory_consumption ();
981 if (mg_faces !=
nullptr)
984 for (
unsigned int i = 0; i < mg_vertex_dofs.size (); ++i)
985 mem +=
sizeof (MGVertexDoFs) + (1 + mg_vertex_dofs[i].get_finest_level () - mg_vertex_dofs[i].get_coarsest_level ()) *
sizeof (
types::global_dof_index);
992 template <
int dim,
int spacedim>
996 ExcMessage(
"You need to set the Triangulation in the DoFHandler using initialize() or " 997 "in the constructor before you can distribute DoFs."));
998 Assert (tria->n_levels() > 0,
999 ExcMessage(
"The Triangulation you are using is empty!"));
1003 if (fe_collection.size() == 0 || fe_collection[0] != ff)
1026 number_cache = policy->distribute_dofs ();
1033 block_info_object.initialize(*
this,
false,
true);
1038 template <
int dim,
int spacedim>
1041 this->distribute_mg_dofs();
1046 template <
int dim,
int spacedim>
1049 Assert(levels.size()>0,
ExcMessage(
"Distribute active DoFs using distribute_dofs() before calling distribute_mg_dofs()."));
1053 ExcMessage(
"The mesh smoothing requirement 'limit_level_difference_at_vertices' has to be set for using multigrid!"));
1057 internal::DoFHandlerImplementation::Implementation::reserve_space_mg (*
this);
1058 mg_number_cache = policy->distribute_mg_dofs ();
1065 block_info_object.initialize (*
this,
true,
false);
1070 template <
int dim,
int spacedim>
1076 std::vector<MGVertexDoFs> tmp;
1080 mg_number_cache.clear();
1084 template <
int dim,
int spacedim>
1087 block_info_object.initialize_local(*
this);
1092 template <
int dim,
int spacedim>
1102 template <
int dim,
int spacedim>
1106 Assert(levels.size()>0,
ExcMessage(
"You need to distribute DoFs before you can renumber them."));
1111 Assert(new_numbers.size() == n_dofs() || new_numbers.size() == n_locally_owned_dofs(),
1112 ExcMessage(
"Incorrect size of the input array."));
1132 if (n_locally_owned_dofs() == n_dofs())
1134 std::vector<types::global_dof_index> tmp(new_numbers);
1135 std::sort (tmp.begin(), tmp.end());
1136 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
1138 for (; p!=tmp.end(); ++p, ++i)
1139 Assert (*p == i, ExcNewNumbersNotConsecutive(i));
1143 Assert (new_numbers[i] < n_dofs(),
1144 ExcMessage (
"New DoF index is not less than the total number of dofs."));
1147 number_cache = policy->renumber_dofs (new_numbers);
1151 template <
int dim,
int spacedim>
1154 const std::vector<types::global_dof_index> &new_numbers)
1156 Assert(mg_levels.size()>0 && levels.size()>0,
1157 ExcMessage(
"You need to distribute active and level DoFs before you can renumber level DoFs."));
1159 AssertDimension (new_numbers.size(), locally_owned_mg_dofs(level).n_elements());
1166 if (n_locally_owned_dofs() == n_dofs())
1168 std::vector<types::global_dof_index> tmp(new_numbers);
1169 std::sort (tmp.begin(), tmp.end());
1170 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
1172 for (; p!=tmp.end(); ++p, ++i)
1173 Assert (*p == i, ExcNewNumbersNotConsecutive(i));
1177 Assert (new_numbers[i] < n_dofs(level),
1178 ExcMessage (
"New DoF index is not less than the total number of dofs."));
1181 mg_number_cache[level] = policy->renumber_mg_dofs (level, new_numbers);
1186 template <
int dim,
int spacedim>
1195 template <
int dim,
int spacedim>
1202 return get_fe().dofs_per_vertex;
1204 return (3*get_fe().dofs_per_vertex +
1205 2*get_fe().dofs_per_line);
1223 return (19*get_fe().dofs_per_vertex +
1224 28*get_fe().dofs_per_line +
1225 8*get_fe().dofs_per_quad);
1234 template <
int dim,
int spacedim>
1240 std::vector<types::global_dof_index> tmp;
1243 number_cache.clear ();
1248 template <
int dim,
int spacedim>
1249 template <
int structdim>
1252 const unsigned int obj_index,
1253 const unsigned int fe_index,
1254 const unsigned int local_index)
const 1256 return internal::DoFHandlerImplementation::Implementation::get_dof_index (*
this, this->mg_levels[obj_level],
1257 this->mg_faces, obj_index,
1258 fe_index, local_index,
1259 std::integral_constant<int, structdim> ());
1264 template <
int dim,
int spacedim>
1265 template <
int structdim>
1267 const unsigned int obj_index,
1268 const unsigned int fe_index,
1269 const unsigned int local_index,
1272 internal::DoFHandlerImplementation::Implementation::set_dof_index (*
this,
1273 this->mg_levels[obj_level],
1279 std::integral_constant<int, structdim> ());
1284 template <
int dim,
int spacedim>
1287 coarsest_level (
numbers::invalid_unsigned_int),
1293 template <
int dim,
int spacedim>
1295 const unsigned int fl,
1296 const unsigned int dofs_per_vertex)
1298 coarsest_level = cl;
1301 if (coarsest_level <= finest_level)
1303 const unsigned int n_levels = finest_level - coarsest_level + 1;
1304 const unsigned int n_indices = n_levels * dofs_per_vertex;
1306 indices = std_cxx14::make_unique<types::global_dof_index[]> (n_indices);
1307 std::fill (indices.get(), indices.get()+n_indices,
1316 template <
int dim,
int spacedim>
1319 return coarsest_level;
1324 template <
int dim,
int spacedim>
1327 return finest_level;
1332 #include "dof_handler.inst" 1335 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
#define AssertDimension(dim1, dim2)
cell_iterator begin(const unsigned int level=0) const
cell_iterator end() const
#define AssertIndexRange(index, range)
static unsigned int max_couplings_between_dofs(const DoFHandler< 1, spacedim > &dof_handler)
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > levels
IteratorRange< level_cell_iterator > mg_cell_iterators_on_level(const unsigned int level) const
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
void initialize(const Triangulation< dim, spacedim > &tria, const FiniteElement< dim, spacedim > &fe)
std::unique_ptr<::internal::DoFHandlerImplementation::Policy::PolicyBase< dim, spacedim > > policy
active_cell_iterator begin_active(const unsigned int level=0) const
static ::ExceptionBase & ExcMessage(std::string arg1)
ActiveSelector::cell_iterator cell_iterator
unsigned int global_dof_index
virtual void distribute_mg_dofs()
#define Assert(cond, exc)
IteratorRange< active_cell_iterator > active_cell_iterators() const
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
types::global_dof_index n_dofs() const
level_cell_iterator begin_mg(const unsigned int level=0) const
std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces< dim > > faces
unsigned int get_finest_level() const
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
void swap(Vector< Number > &u, Vector< Number > &v)
void initialize_local_block_info()
static void reserve_space(DoFHandler< 1, spacedim > &dof_handler)
IteratorRange< level_cell_iterator > mg_cell_iterators() const
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)
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
static ::ExceptionBase & ExcNotImplemented()
const Triangulation< dim, spacedim > & get_triangulation() const
Iterator points to a valid object.
const types::boundary_id internal_face_boundary_id
unsigned int max_couplings_between_boundary_dofs() const
const types::global_dof_index invalid_dof_index
IteratorState::IteratorStates state() const
IteratorRange< cell_iterator > cell_iterators() const
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()