Merge pull request #2833 from athomps/delete-last-mol

Delete last mol
This commit is contained in:
Axel Kohlmeyer
2021-07-15 17:16:48 -04:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@ -451,6 +451,11 @@ When using fix gcmc in combination with fix shake or fix rigid,
only GCMC exchange moves are supported, so the argument
*M* must be zero.
When using fix gcmc in combination with fix rigid, deletion
of the last remaining molecule is not allowed for technical reasons,
and so the molecule count will never drop below 1, regardless of the
specified chemical potential.
Note that very lengthy simulations involving insertions/deletions of
billions of gas molecules may run out of atom or molecule IDs and
trigger an error, so it is better to run multiple shorter-duration

View File

@ -1230,7 +1230,7 @@ void FixGCMC::attempt_molecule_deletion()
// work-around to avoid n=0 problem with fix rigid/nvt/small
if (ngas == natoms_per_molecule) return;
if (rigidflag && ngas == natoms_per_molecule) return;
tagint deletion_molecule = pick_random_gas_molecule();
if (deletion_molecule == -1) return;
@ -1900,7 +1900,7 @@ void FixGCMC::attempt_molecule_deletion_full()
// work-around to avoid n=0 problem with fix rigid/nvt/small
if (ngas == natoms_per_molecule) return;
if (rigidflag && ngas == natoms_per_molecule) return;
tagint deletion_molecule = pick_random_gas_molecule();
if (deletion_molecule == -1) return;