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
The system.analysis.nbhood(pos=None, r_catch=None, plane='3d') function has two search mode: spherical region (default) and slab region. The slab search is incorrect, because the bitmask is inverted. Instead of searching for particles within a distance r_catch of a plane, it searches for particles in a cylinder of radius r_catch perpendicular to the plane. There is no python test for the slab search mode. The slab search mode was already incorrect in the Tcl version of ESPResSo, and it doesn't take Lees-Edwards boundary conditions into account.
MWE:
importespressomdimportnumpyasnpsystem=espressomd.System(box_l=3* [10])
origin=np.array([10., 10., 0.])
offset=4.search_dist=1.system.part.add(pos=origin+ [0., 0., 0.]) # inside sphere, distance to center is 0system.part.add(pos=origin+ [0., 0., offset]) # inside cylinder, distance to z-axis is 0system.part.add(pos=origin+ [offset, 0., 0.]) # inside slab, distance to xy-plane is 0print(system.analysis.nbhood(origin, search_dist, plane='3d'))
print(system.analysis.nbhood(origin, search_dist, plane='xy'))
Output:
[0]
[0, 1]
Expected output:
[0]
[0, 2]
Visual inspection (only particles in the neighborhood appear in the visualizer):
Description of changes:
- user guide:
- cleanup code examples and fix bond breakage documentation (e.g. mode `"bind_centers"` vs. `"bond_centers"`)
- document ghost particles side-effects on observables
- where changes were made, wrap text to ~80 chars per line to make git diffs more readable
- python testsuite:
- reduce code duplication by merging similar tests together and by using `tests_common.py` more often
- improve code coverage by rewriting assertions
- bug fixes:
- the incorrectly implemented slab search mode of `system.analysis.nbhood()` was removed (fixes#4517)
- `TabulatedNonBonded.is_active()` now returns `False` instead of `None` when the bond is inactive
- always checks for runtime errors when the cell system changes or when a `ScriptInterface` object is instantiated
- API changes:
- script interface methods no longer return `True` to signal they didn't raise an exception
- script interface improvements:
- simplify `System` class and document why the `_Globals` class (now renamed to `_BoxGeometry`) has to exist
- simplify `ScriptInterfaceHelper` classes using automatically generated member methods
- simplify several core functions that are included in pxd files
The
system.analysis.nbhood(pos=None, r_catch=None, plane='3d')
function has two search mode: spherical region (default) and slab region. The slab search is incorrect, because the bitmask is inverted. Instead of searching for particles within a distancer_catch
of a plane, it searches for particles in a cylinder of radiusr_catch
perpendicular to the plane. There is no python test for the slab search mode. The slab search mode was already incorrect in the Tcl version of ESPResSo, and it doesn't take Lees-Edwards boundary conditions into account.MWE:
Output:
Expected output:
Visual inspection (only particles in the neighborhood appear in the visualizer):
The text was updated successfully, but these errors were encountered: