extract_inner_interface_dofs(const DoFHandler<dim, spacedim> &mg_dof_handler,
std::vector<IndexSet> & interface_dofs);
- /**
- * For each level in a multigrid hierarchy, produce a std::set of degrees of
- * freedoms that are not located along interfaces of this level to cells that
- * only exist on coarser levels.
- *
- * @deprecated Use extract_inner_interface_dofs() for computing the complement
- * of degrees of freedoms instead.
- */
- template <int dim, int spacedim>
- DEAL_II_DEPRECATED void
- extract_non_interface_dofs(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
- std::vector<std::set<types::global_dof_index>> &non_interface_dofs);
-
/**
* Return the highest possible level that can be used as the coarsest level in
* a Multigrid computation, that is, the highest level in the hierarchy whose
}
- template <int dim, int spacedim>
- void
- extract_non_interface_dofs(
- const DoFHandler<dim, spacedim> & mg_dof_handler,
- std::vector<std::set<types::global_dof_index>> &non_interface_dofs)
- {
- Assert(non_interface_dofs.size() ==
- mg_dof_handler.get_triangulation().n_global_levels(),
- ExcDimensionMismatch(
- non_interface_dofs.size(),
- mg_dof_handler.get_triangulation().n_global_levels()));
-
- const FiniteElement<dim, spacedim> &fe = mg_dof_handler.get_fe();
-
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int dofs_per_face = fe.dofs_per_face;
-
- std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
- std::vector<bool> cell_dofs(dofs_per_cell, false);
- std::vector<bool> cell_dofs_interface(dofs_per_cell, false);
-
- typename DoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
- endc = mg_dof_handler.end();
-
-
- for (; cell != endc; ++cell)
- {
- if (mg_dof_handler.get_triangulation().locally_owned_subdomain() !=
- numbers::invalid_subdomain_id &&
- cell->level_subdomain_id() !=
- mg_dof_handler.get_triangulation().locally_owned_subdomain())
- continue;
-
- std::fill(cell_dofs.begin(), cell_dofs.end(), false);
- std::fill(cell_dofs_interface.begin(),
- cell_dofs_interface.end(),
- false);
-
- for (const unsigned int face_nr : GeometryInfo<dim>::face_indices())
- {
- const typename DoFHandler<dim, spacedim>::face_iterator face =
- cell->face(face_nr);
- if (!face->at_boundary() || cell->has_periodic_neighbor(face_nr))
- {
- // interior face
- const typename DoFHandler<dim>::cell_iterator neighbor =
- cell->neighbor_or_periodic_neighbor(face_nr);
-
- if ((neighbor->level() < cell->level()))
- {
- for (unsigned int j = 0; j < dofs_per_face; ++j)
- cell_dofs_interface[fe.face_to_cell_index(j, face_nr)] =
- true;
- }
- else
- {
- for (unsigned int j = 0; j < dofs_per_face; ++j)
- cell_dofs[fe.face_to_cell_index(j, face_nr)] = true;
- }
- }
- else
- {
- // boundary face
- for (unsigned int j = 0; j < dofs_per_face; ++j)
- cell_dofs[fe.face_to_cell_index(j, face_nr)] = true;
- }
- }
-
- const unsigned int level = cell->level();
- cell->get_mg_dof_indices(local_dof_indices);
-
- for (unsigned int i = 0; i < dofs_per_cell; ++i)
- if (cell_dofs[i] && !cell_dofs_interface[i])
- non_interface_dofs[level].insert(local_dof_indices[i]);
- }
- }
-
template <int dim, int spacedim>
void