Skip to content

Commit

Permalink
Add an assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
bangerth committed Sep 27, 2023
1 parent 368e863 commit ef53aa1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/base/index_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,10 @@ IndexSet::add_indices(const IndexSet &other, const size_type offset)
bool
IndexSet::is_subset_of(const IndexSet &other) const
{
Assert(size() == other.size(),
ExcMessage("One index set can only be a subset of another if they "
"describe index spaces of the same size."));

// See whether there are indices in the current set that are not in 'other'.
// If so, then this is clearly not a subset of 'other'.
IndexSet A_minus_B = *this;
Expand Down

0 comments on commit ef53aa1

Please sign in to comment.