Skip to content

Commit

Permalink
Do not wrap particles until rebuilding the tree
Browse files Browse the repository at this point in the history
This was causing the tree to never be rebuilt because the particles were
wrapped back into the primary image before the displacement check was
performed. And since the diaplacement check used the minimum
plane-to-plane distance, the particle could never really move far enough
to trigger a rebuild. This may have been leading to rare overlaps.
  • Loading branch information
tcmoore3 committed Dec 18, 2024
1 parent b1100d2 commit 33c16cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hoomd/hpmc/UpdaterVirtualMoveMonteCarlo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,6 @@ template<class Shape> void UpdaterVMMC<Shape>::update(uint64_t timestep)
vec3<Scalar> new_pos = m_positions_after_move[idx];
h_postype.data[idx]
= make_scalar4(new_pos.x, new_pos.y, new_pos.z, postype_idx.w);
box.wrap(h_postype.data[idx], h_image.data[idx]);
vec3<Scalar> displacement
= vec3<Scalar>(h_postype.data[idx])
- vec3<Scalar>(h_pos_last_tree_build.data[idx]);
Expand All @@ -1149,13 +1148,16 @@ template<class Shape> void UpdaterVMMC<Shape>::update(uint64_t timestep)
// update pos_last_tree_build
for (unsigned int idx = 0; idx < m_pdata->getN(); idx++)
{
box.wrap(h_postype.data[idx], h_image.data[idx]);
h_pos_last_tree_build.data[idx] = h_postype.data[idx];
}
m_count_total.num_aabbtree_builds++;
}
else
{
for (unsigned int idx = 0; idx < m_pdata->getN(); idx++)
{
// TODO: only loop over the m_cluster_data elements
if (!(m_cluster_data.m_linkers_added.find(idx)
== m_cluster_data.m_linkers_added.end()))
{
Expand Down

0 comments on commit 33c16cf

Please sign in to comment.