Skip to content

When Lz < 4·rMaxLimit, the stencil cannot reach every reacting pair #16

Description

@yingyue2030699

When Lz < 4 · rMaxLimit, the stencil cannot reach every reacting pair

z = std::max(4, ...) forces four z-cells regardless of the box thickness, and check_dimensions() reapplies the same floor rather than correcting it.

Below Lz = 4 · rMaxLimit, the cells become thinner than the interaction range, and the ±1 stencil no longer covers the full range. Pairs separated by two cells along z are therefore never passed to check_bimolecular_reactions().

Measured using the rev_3D model—with 2,000 molecules, rMaxLimit = 16.70 nm, 1,000 steps, and 19 snapshots—while varying the box thickness and counting every pair by brute force:

Box Lz cells_z Z-cell size rMaxLimit Pairs in range Reached by stencil Missed
30 nm 4 7.50 nm 16.70 nm 29,123 26,951 2,172 (7.5%)
50 nm 4 12.50 nm 16.70 nm 20,475 20,391 84 (0.41%)
100 nm 5 20.00 nm 16.70 nm 11,350 11,350 0
940 nm 30 31.33 nm 16.70 nm 1,328 1,328 0

The boundary is exactly where the arithmetic predicts:

  • Zero missed pairs whenever the z-cell size is greater than or equal to rMaxLimit.
  • Nonzero missed pairs as soon as the four-cell floor forces the z-cell size below rMaxLimit.

This produces a systematic bias in the association rate, not a statistical fluctuation, and it occurs silently.

Origin

This issue is pre-existing. The implementations in Dimensions() and check_dimensions() are byte-identical to those on master; the nerdss-optimized branch neither introduced nor fixed the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions