// The next few internal helper functions are needed to support various
- // DoFIndicesType kinds, e.g. actual vectors of DoFIndices or dummy
+ // DoFIndicesType kinds, e.g. actual vectors of DoFIndices or empty
// types that we use when we only want to work on the internally stored
// DoFs and never extract any number.
static unsigned int
}
static unsigned int
- get_array_length(const int &)
+ get_array_length(const std::tuple<> &)
{
return 0;
}
return array[index];
}
- static unsigned int
- get_array_entry(const int &, const unsigned int)
+ static types::global_dof_index
+ get_array_entry(const std::tuple<> &, const unsigned int)
{
- return 0;
+ return numbers::invalid_dof_index;
}
const auto &fe = accessor.get_fe(fe_index);
- // we want to pass in rvalue 'int' types as `DoFIndicesType`, but we
- // need non-const references for std::vector<> types, so get in a
- // const reference here and immediately cast it away
+ // we want to pass in rvalue 'std::tuple<>' types as `DoFIndicesType`,
+ // but we need non-const references for std::vector<> types, so get in
+ // a const reference here and immediately cast the constness away -
+ // note that we prevent the use of the dereferenced invalid type, as
+ // we only return an rvalue `types::global_dof_index` into the lambda
+ // function DoFOperation that operates on it
DoFIndicesType &dof_indices =
const_cast<DoFIndicesType &>(const_dof_indices);
((subdomain_id == numbers::invalid_subdomain_id) ||
(cell->subdomain_id() == subdomain_id)))
{
- // need to create a dummy int reference to feed the
- // process_dof_indices function for the case we do want want
- // to retrieve any index
+ // feed the process_dof_indices function with an empty type
+ // `std::tuple<>`, as we do not want to retrieve any DoF
+ // indices here and rather modify the stored ones
DoFAccessorImplementation::Implementation::process_dof_indices(
*cell,
- 0,
+ std::make_tuple(),
cell->active_fe_index(),
DoFAccessorImplementation::Implementation::
DoFIndexProcessor<dim, spacedim, false>(),
{
DoFAccessorImplementation::Implementation::process_dof_indices(
*cell,
- 0,
+ std::make_tuple(),
0,
DoFAccessorImplementation::Implementation::
MGDoFIndexProcessor<dim, spacedim>(level),
{
DoFAccessorImplementation::Implementation::process_dof_indices(
*cell,
- 0,
+ std::make_tuple(),
cell->active_fe_index(),
DoFAccessorImplementation::Implementation::
DoFIndexProcessor<dim, spacedim, false>(),
{
DoFAccessorImplementation::Implementation::process_dof_indices(
*cell,
- 0,
+ std::make_tuple(),
0,
DoFAccessorImplementation::Implementation::
MGDoFIndexProcessor<dim, spacedim>(cell->level()),