Skip to content

Commit

Permalink
Core: Use std:any_of instead of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
RudolfWeeber committed Oct 28, 2018
1 parent cbcdf09 commit ee57ccf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/core/virtual_sites/VirtualSitesInertialessTracers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "errorhandling.hpp"
#include "lattice.hpp"
#include "virtual_sites/lb_inertialess_tracers.hpp"
#include <algorithm>

void VirtualSitesInertialessTracers::after_force_calc() {
// Now the forces are computed and need to go into the LB fluid
Expand All @@ -39,14 +40,14 @@ void VirtualSitesInertialessTracers::after_force_calc() {
return;
}
#endif
for (auto &p : local_cells.particles()) {
if (p.p.is_virtual) {
runtimeErrorMsg() << "Inertialess Tracers: No LB method was active but "
"virtual sites present.";
return;
}
if (std::any_of(local_cells.particles,
[](Particle &p) { return p.p.virtual != 0; })) {
runtimeErrorMsg() << "Inertialess Tracers: No LB method was active but "
"virtual sites present.";
return;
}
}
}

void VirtualSitesInertialessTracers::after_lb_propagation() {
#ifdef VIRTUAL_SITES_INERTIALESS_TRACERS
Expand Down

0 comments on commit ee57ccf

Please sign in to comment.