Skip to content

Commit

Permalink
Optimize loop over stress field indices
Browse files Browse the repository at this point in the history
  • Loading branch information
anne-glerum committed Jun 2, 2024
1 parent 076b970 commit 89634b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/material_model/rheology/visco_plastic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ namespace aspect
// Set a mask (false) for the 2*n_independent_components fields representing the viscoelastic
// stress tensor components so that they are excluded from the volume fraction computation.
const std::vector<unsigned int> &stress_field_indices = this->introspection().get_indices_for_fields_of_type(CompositionalFieldDescription::stress);
for (auto it = stress_field_indices.begin(); it != stress_field_indices.end(); ++it)
composition_mask.set(*it, false);
for (unsigned int field_index: stress_field_indices)
composition_mask.set(field_index, false);
}

return composition_mask;
Expand Down

0 comments on commit 89634b3

Please sign in to comment.