Skip to content
Permalink
Browse files

core: Fixed faultiy assert conditions in cells

  • Loading branch information
fweik committed Mar 24, 2020
1 parent 0dbb0c8 commit f01d6712ce52c305efd523d9a45516c813bc23cb
Showing with 6 additions and 8 deletions.
  1. +5 −5 src/core/CellStructure.hpp
  2. +1 −3 src/core/virtual_sites/lb_inertialess_tracers.cpp
@@ -241,26 +241,26 @@ struct CellStructure {
private:
/** One of @ref Cells::Resort, announces the level of resort needed.
*/
unsigned resort_particles = Cells::RESORT_NONE;
unsigned m_resort_particles = Cells::RESORT_NONE;

public:
/**
* @brief Increase the local resort level at least to @p level.
*/
void set_resort_particles(Cells::Resort level) {
resort_particles |= level;
assert(resort_particles & level);
m_resort_particles |= level;
assert(m_resort_particles >= level);
}

/**
* @brief Get the currently scheduled resort level.
*/
unsigned get_resort_particles() const { return resort_particles; }
unsigned get_resort_particles() const { return m_resort_particles; }

/**
* @brief Set the resort level to sorted.
*/
void clear_resort_particles() { resort_particles = Cells::RESORT_NONE; }
void clear_resort_particles() { m_resort_particles = Cells::RESORT_NONE; }
};

#endif // ESPRESSO_CELLSTRUCTURE_HPP
@@ -116,9 +116,7 @@ void IBM_UpdateParticlePositions(ParticleRange particles) {
#endif
p.r.p[2] = p.r.p[2] + p.m.v[2] * time_step;

// Check if the particle might have crossed a box border (criterion see
// e-mail Axel 28.8.2014)
// if possible, use resort_particles = Cells::RESORT_LOCAL)
// Check if the particle might have crossed a box border
const double dist2 = (p.r.p - p.l.p_old).norm2();
if (dist2 > skin2) {
cell_structure.set_resort_particles(Cells::RESORT_LOCAL);

0 comments on commit f01d671

Please sign in to comment.
You can’t perform that action at this time.