Assert (local_index < (*finite_elements)[fe_index].dofs_per_vertex,
ExcIndexRange(local_index, 0,
(*finite_elements)[fe_index].dofs_per_vertex));
-
+ Assert (vertex_index < vertex_dofs_offsets.size(),
+ ExcIndexRange (vertex_index, 0, vertex_dofs_offsets.size()));
+
// hop along the list of index
// sets until we find the one
// with the correct fe_index, and
const unsigned int *pointer = &vertex_dofs[starting_offset];
while (true)
{
- Assert (*pointer != deal_II_numbers::invalid_unsigned_int,
+ Assert (pointer <= &vertex_dofs.back(), ExcInternalError());
+
+ const unsigned int this_fe_index = *pointer;
+
+ Assert (this_fe_index != deal_II_numbers::invalid_unsigned_int,
ExcInternalError());
- if (*pointer == fe_index)
+ Assert (this_fe_index < finite_elements->size(),
+ ExcInternalError());
+
+ if (this_fe_index == fe_index)
return *(pointer + 1 + local_index);
else
- pointer += (*finite_elements)[*pointer].dofs_per_vertex;
+ pointer += (*finite_elements)[this_fe_index].dofs_per_vertex;
}
}