compute_component_wise<dim,spacedim,
typename DoFHandler<dim,spacedim>::active_cell_iterator,
typename DoFHandler<dim,spacedim>::level_cell_iterator>
- (renumbering, start, end, component_order_arg);
+ (renumbering, start, end, component_order_arg, false);
if (result == 0)
return;
compute_component_wise<hp::DoFHandler<dim>::dimension,hp::DoFHandler<dim>::space_dimension,
typename hp::DoFHandler<dim>::active_cell_iterator,
typename hp::DoFHandler<dim>::level_cell_iterator>
- (renumbering, start, end, component_order_arg);
+ (renumbering, start, end, component_order_arg, false);
if (result == 0) return;
const unsigned int result =
compute_component_wise<DH::dimension, DH::space_dimension,
typename DH::level_cell_iterator, typename DH::level_cell_iterator>
- (renumbering, start, end, component_order_arg);
+ (renumbering, start, end, component_order_arg, true);
if (result == 0) return;
compute_component_wise (std::vector<unsigned int> &new_indices,
const ITERATOR &start,
const ENDITERATOR &end,
- const std::vector<unsigned int> &component_order_arg)
+ const std::vector<unsigned int> &component_order_arg,
+ bool is_level_operation)
{
const hp::FECollection<dim,spacedim>
fe_collection (start->get_dof_handler().get_fe ());
std::vector<std::vector<unsigned int> >
component_to_dof_map (fe_collection.n_components());
for (ITERATOR cell=start; cell!=end; ++cell)
- if (cell->is_locally_owned())
- {
- // on each cell: get dof indices
- // and insert them into the global
- // list using their component
- const unsigned int fe_index = cell->active_fe_index();
- const unsigned int dofs_per_cell = fe_collection[fe_index].dofs_per_cell;
- local_dof_indices.resize (dofs_per_cell);
- cell->get_active_or_mg_dof_indices (local_dof_indices);
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- if (start->get_dof_handler().locally_owned_dofs().is_element(local_dof_indices[i]))
- component_to_dof_map[component_list[fe_index][i]].
- push_back (local_dof_indices[i]);
- }
+ {
+ if (is_level_operation)
+ {
+ //we are dealing with mg dofs, skip foreign level cells:
+ if (cell->level_subdomain_id()!=start->get_dof_handler().get_tria().locally_owned_subdomain())
+ continue;
+ }
+ else
+ {
+ //we are dealing with active dofs, skip the loop if not locally
+ // owned:
+ if (!cell->active() || !cell->is_locally_owned())
+ continue;
+ }
+ // on each cell: get dof indices
+ // and insert them into the global
+ // list using their component
+ const unsigned int fe_index = cell->active_fe_index();
+ const unsigned int dofs_per_cell = fe_collection[fe_index].dofs_per_cell;
+ local_dof_indices.resize (dofs_per_cell);
+ cell->get_active_or_mg_dof_indices (local_dof_indices);
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ if (start->get_dof_handler().locally_owned_dofs().is_element(local_dof_indices[i]))
+ component_to_dof_map[component_list[fe_index][i]].
+ push_back (local_dof_indices[i]);
+ }
// now we've got all indices sorted
// into buckets labeled by their