Skip to content

Fix issue #277 - #278

Merged
lohedges merged 1 commit into
develfrom
fix_277
Nov 8, 2026
Merged

lohedges merged 1 commit into
develfrom
fix_277

Conversation

@lohedges

@lohedges lohedges commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Closes #277.

gcmc_bulk_sampling_probability now defaults to "auto": 0.1 in the NVT ensemble and 0 when a pressure is set. Bulk moves act as a barostat for NVT GCMC. Under a barostat, whole-box moves are only well behaved when the chemical potential of the inserted species depends strongly on how much is present. SOMD2 always exchanges the solvent water of a dilute system, whose chemical potential is almost that of pure water, so the number of waters is barely fixed and can drift. Sampling within the GCMC sphere with the barostat controlling the density is well-defined. An explicit value is never overridden.

A warning is logged when bulk moves are used with a pressure, or when gcmc_selection is None with a pressure, since every move then samples the whole box. The previous defaults (no selection, 1 atm) are this case, so default GCMC runs will now see the warning.

On restart, "auto" keeps the value of the last run, so runs started before this change restart unchanged. Any other change is refused, since it would mix two ensembles in one set of energies. A changed pressure is reported as such. "auto" is kept as given in the written config, and NaN is now rejected.

The loch README now documents when whole-box moves are unsuitable in the osmotic ensemble (OpenBioSim/loch#60).

@lohedges lohedges added the bug Something isn't working label Nov 8, 2026
@lohedges
lohedges merged commit 5b13903 into devel Nov 8, 2026
4 checks passed
@lohedges
lohedges deleted the fix_277 branch November 8, 2026 18:07
This was referenced Nov 8, 2026

This branch was previously deployed

1 inactive deployment
somd2-build — 6280903b Deployed Nov 8, 2026 by lohedges via build (3.10, linux) #142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't use GCMC bulk sampling by default in the osmotic ensemble

1 participant