You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the auto exclusions code that has always been present since the functionality was introduced in v2.2.0b by a48ed7c: the bond distance is interpreted as a particle id, because the loop counter is incremented by 1 instead of by 2. The 2D bookkeeping array is flattened in such a way that bond distances and ids are interleaved, thus requiring an increment by 2. We end up with spurious exclusions to particles with id 1 to n, with n the maximal bond distance requested by the user. If the particle list has a gap in the id range 1 to n, an error is raised.
MWE:
importespressomdsystem=espressomd.System(box_l=[1.0, 1.0, 1.0])
bond=espressomd.interactions.Virtual()
system.bonded_inter.add(bond)
forpidin [0, 1, 2, 3]: # use [0, 2, 3] to crash the simulationsystem.part.add(id=pid, pos=[0, 0, 0])
system.part.by_id(0).add_bond((bond, 3))
system.auto_exclusions(1)
forpinsystem.part.all():
print(p.id, "->", p.exclusions)
Output:
0 -> [3 1]
1 -> [0]
2 -> []
3 -> [0]
Expected output:
0 -> [3]
1 -> []
2 -> []
3 -> [0]
This bug was never caught by the testsuite, because the test case only checks for linear topologies with contiguous particle ids starting from 0.
The text was updated successfully, but these errors were encountered:
The bond length is no longer misinterpreted as a bond id
(fixes bug introduced by a48ed7c).
Fixesespressomd#4652
Description of changes:
- the feature now works with non-contiguous particle ids
- the feature no longer adds spurious exclusions to particle ids in the range `[1, distance]`
- completely rewrite the test case to check all topologies and regular decompositions
There is a bug in the auto exclusions code that has always been present since the functionality was introduced in v2.2.0b by a48ed7c: the bond distance is interpreted as a particle id, because the loop counter is incremented by 1 instead of by 2. The 2D bookkeeping array is flattened in such a way that bond distances and ids are interleaved, thus requiring an increment by 2. We end up with spurious exclusions to particles with id
1 to n
, withn
the maximal bond distance requested by the user. If the particle list has a gap in the id range1 to n
, an error is raised.MWE:
Output:
Expected output:
This bug was never caught by the testsuite, because the test case only checks for linear topologies with contiguous particle ids starting from 0.
The text was updated successfully, but these errors were encountered: