unsigned int
active_fe_index (const DoFCellAccessor<DoFHandler<dim,spacedim>, level_dof_access> &)
{
- // ::DoFHandler only supports a
- // single active fe with index
+ // ::DoFHandler only supports a single active fe with index
// zero
return 0;
}
const unsigned int i)
{
(void)i;
- // ::DoFHandler only supports a
- // single active fe with index
+ // ::DoFHandler only supports a single active fe with index
// zero
typedef dealii::DoFAccessor<dim,DoFHandler<dim,spacedim>, level_dof_access> BaseClass;
Assert (i == 0, typename BaseClass::ExcInvalidObject());
"children because no degrees of freedom are assigned "
"to this cell and, consequently, no finite element "
"is associated with it."));
+ Assert ((dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
+ (this->dof_handler) != nullptr)
+ ||
+ (this->is_locally_owned() || this->is_ghost()),
+ ExcMessage ("You can only query active_fe_index information on cells "
+ "that are either locally owned or (after distributing "
+ "degrees of freedom) are ghost cells."));
+
return dealii::internal::DoFCellAccessor::Implementation::active_fe_index (*this);
}
ExcMessage ("You can not set the active_fe_index on a cell that has "
"children because no degrees of freedom will be assigned "
"to this cell."));
+
+ if (i != DoFHandlerType::default_fe_index)
+ Assert ((dynamic_cast<const dealii::DoFHandler<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*>
+ (this->dof_handler) != nullptr)
+ ||
+ this->is_locally_owned(),
+ ExcMessage ("You can only set active_fe_index information on cells "
+ "that are locally owned. On ghost cells, this information "
+ "will automatically be propagated from the owning process "
+ "of that cell, and there is no information at all on "
+ "artificial cells."));
dealii::internal::DoFCellAccessor::Implementation::set_active_fe_index (*this, i);
}
active_cell_iterator cell=begin_active(),
endc=end();
for (unsigned int i=0; cell!=endc; ++cell, ++i)
- cell->set_active_fe_index(active_fe_indices[i]);
+ if (cell->is_locally_owned())
+ cell->set_active_fe_index(active_fe_indices[i]);
}
active_cell_iterator cell=begin_active(),
endc=end();
for (unsigned int i=0; cell!=endc; ++cell, ++i)
- active_fe_indices[i]=cell->active_fe_index();
+ active_fe_indices[i] = cell->active_fe_index();
}
// cell->active_fe_index() since that function is not
// allowed for inactive cells, but we can access this
// information from the DoFLevels directly
+ //
+ // we don't have to set the active_fe_index for ghost
+ // cells -- these will be exchanged automatically
+ // upon distribute_dofs()
for (unsigned int i = 0; i < cell->n_children(); ++i)
- cell->child (i)->set_active_fe_index
- (levels[cell->level()]->active_fe_index (cell->index()));
+ if (cell->child (i)->is_locally_owned())
+ cell->child (i)->set_active_fe_index
+ (levels[cell->level()]->active_fe_index (cell->index()));
}
}
}