From a741fcf859c27c68bcaa15d44ac78ebc9117e28d Mon Sep 17 00:00:00 2001 From: pscrozi Date: Thu, 11 Apr 2013 23:20:40 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9771 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MC/fix_gcmc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 142a2c3093..c91b834dea 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -715,7 +715,7 @@ void FixGCMC::attempt_molecule_deletion() double deletion_energy_sum = molecule_energy(deletion_molecule); - if (random_equal->uniform() < ngas*exp(beta*deletion_energy_sum)/(zz*volume)) { + if (random_equal->uniform() < ngas*exp(beta*deletion_energy_sum)/(zz*volume*natoms_per_molecule)) { int i = 0; while (i < atom->nlocal) { if (atom->molecule[i] == deletion_molecule) { @@ -791,7 +791,7 @@ void FixGCMC::attempt_molecule_insertion() double insertion_energy_sum = 0.0; MPI_Allreduce(&insertion_energy,&insertion_energy_sum,1,MPI_DOUBLE,MPI_SUM,world); - if (random_equal->uniform() < zz*volume*exp(-beta*insertion_energy_sum)/(ngas+1)) { + if (random_equal->uniform() < zz*volume*natoms_per_molecule*exp(-beta*insertion_energy_sum)/(ngas+1)) { maxmol++; if (maxmol >= MAXSMALLINT) error->all(FLERR,"Fix gcmc ran out of available molecule IDs");