Skip to content

fix: resolve polymer placement failures from undersized MC box#3

Merged
Chenghao-Wu merged 1 commit into
v1.0from
fix/mc-box-sizing-and-fallback
Mar 19, 2026
Merged

fix: resolve polymer placement failures from undersized MC box#3
Chenghao-Wu merged 1 commit into
v1.0from
fix/mc-box-sizing-and-fallback

Conversation

@Chenghao-Wu

Copy link
Copy Markdown
Collaborator

Summary

  • Added chain-packing volume estimate to box size calculation — computes total collision sphere volume across all models and derives box size from a 0.3 packing fraction, preventing the box from being too small for many-chain systems (e.g., 200 dodecane chains: ~141 Å vs old ~40 Å)
  • Fixed all three fallback placement paths (molecule, polymer, DOP=1) to use a bounded 3D grid within the simulation box instead of an unbounded 2D grid that placed atoms far outside box boundaries

Test plan

  • Run allatom/dodecane.py (200 chains, dop=6) — reduced from hundreds of placement failures to ≤1
  • Verify workflow completes successfully (LAMMPS data file generated)
  • Confirm all fallback positions are within box bounds in system.lt

🤖 Generated with Claude Code

…t-of-bounds fallback

The box size calculation ignored chain-packing volume, causing the box to be far too small
for systems with many chains (e.g., 200 dodecane chains needed ~141 Å but got ~40 Å).
Added a packing-fraction-based estimate (volume/0.3)^(1/3) to ensure sufficient space.

Also fixed all three fallback placement paths (molecule, polymer, DOP=1) to use a bounded
3D grid within the simulation box instead of an unbounded 2D grid that placed atoms far
outside the box boundaries, which would crash LAMMPS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Chenghao-Wu Chenghao-Wu merged commit 489e062 into v1.0 Mar 19, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant