}
}
- template<int spacedim>
- static
- types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<1, spacedim>::cell_iterator &cell, types::global_dof_index next_free_dof)
- {
- const FiniteElement<1, spacedim> &fe = cell->get_fe ();
-
- if (fe.dofs_per_vertex > 0)
- for (unsigned int vertex = 0; vertex < GeometryInfo<1>::vertices_per_cell; ++vertex)
- {
- typename DoFHandler<1, spacedim>::cell_iterator neighbor = cell->neighbor (vertex);
-
- if (neighbor.state () == IteratorState::valid)
- if (neighbor->user_flag_set () && (neighbor->level () == cell->level ()))
- {
- if (vertex == 0)
- for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
- cell->set_mg_vertex_dof_index (cell->level (), 0, dof, neighbor->mg_vertex_dof_index (cell->level (), 1, dof));
-
- else
- for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
- cell->set_mg_vertex_dof_index (cell->level (), 1, dof, neighbor->mg_vertex_dof_index (cell->level (), 0, dof));
-
- continue;
- }
-
- for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
- cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
- }
-
- if (fe.dofs_per_line > 0)
- for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof)
- cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
-
- cell->set_user_flag ();
- return next_free_dof;
- }
-
- template<int spacedim>
- static
- types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<2, spacedim>::cell_iterator &cell, types::global_dof_index next_free_dof)
- {
- const FiniteElement<2, spacedim> &fe = cell->get_fe ();
-
- if (fe.dofs_per_vertex > 0)
- for (unsigned int vertex = 0; vertex < GeometryInfo<2>::vertices_per_cell; ++vertex)
- if (cell->mg_vertex_dof_index (cell->level (), vertex, 0) == DoFHandler<2>::invalid_dof_index)
- for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
- cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
-
- if (fe.dofs_per_line > 0)
- for (unsigned int face = 0; face < GeometryInfo<2>::faces_per_cell; ++face)
- {
- typename DoFHandler<2, spacedim>::line_iterator line = cell->line (face);
- if (line->mg_dof_index (cell->level (), 0) == DoFHandler<2>::invalid_dof_index)
- for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof)
- line->set_mg_dof_index (cell->level (), dof, next_free_dof++);
- }
-
- if (fe.dofs_per_quad > 0)
- for (unsigned int dof = 0; dof < fe.dofs_per_quad; ++dof)
- cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
-
- cell->set_user_flag ();
- return next_free_dof;
- }
-
- template<int spacedim>
- static
- types::global_dof_index distribute_dofs_on_cell (typename DoFHandler<3, spacedim>::cell_iterator &cell, types::global_dof_index next_free_dof)
- {
- const FiniteElement<3, spacedim> &fe = cell->get_fe ();
-
- if (fe.dofs_per_vertex > 0)
- for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_cell; ++vertex)
- if (cell->mg_vertex_dof_index (cell->level (), vertex, 0) == DoFHandler<3>::invalid_dof_index)
- for (unsigned int dof = 0; dof < fe.dofs_per_vertex; ++dof)
- cell->set_mg_vertex_dof_index (cell->level (), vertex, dof, next_free_dof++);
-
- if (fe.dofs_per_line > 0)
- for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_cell; ++line)
- {
- typename DoFHandler<3, spacedim>::line_iterator line_it = cell->line (line);
-
- if (line_it->mg_dof_index (cell->level (), 0) == DoFHandler<3>::invalid_dof_index)
- for (unsigned int dof = 0; dof < fe.dofs_per_line; ++dof)
- line_it->set_mg_dof_index (cell->level (), dof, next_free_dof++);
- }
-
- if (fe.dofs_per_quad > 0)
- for (unsigned int face = 0; face < GeometryInfo<3>::quads_per_cell; ++face)
- {
- typename DoFHandler<3, spacedim>::quad_iterator quad = cell->quad (face);
-
- if (quad->mg_dof_index (cell->level (), 0) == DoFHandler<3>::invalid_dof_index)
- for (unsigned int dof = 0; dof < fe.dofs_per_quad; ++dof)
- quad->set_mg_dof_index (cell->level (), dof, next_free_dof++);
- }
-
- if (fe.dofs_per_hex > 0)
- for (unsigned int dof = 0; dof < fe.dofs_per_hex; ++dof)
- cell->set_mg_dof_index (cell->level (), dof, next_free_dof++);
-
- cell->set_user_flag ();
- return next_free_dof;
- }
template<int spacedim>
static