From 4b03a29c04e5430290dec74015d190ffc381c1dc Mon Sep 17 00:00:00 2001 From: athomps Date: Mon, 10 Aug 2015 02:57:32 +0000 Subject: [PATCH] Fixed molecule mass when gcmc offset applied git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13849 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MC/fix_gcmc.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index b18e32fbf2..46c30a8376 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -518,10 +518,15 @@ void FixGCMC::init() // otherwise just get the gas mass if (mode == MOLECULE) { + + // apply gcmc offset to types in molecule template + + for (int i = 0; i < onemols[imol]->natoms; i++) + onemols[imol]->type[i] += ngcmc_type; + onemols[imol]->compute_mass(); onemols[imol]->compute_com(); gas_mass = onemols[imol]->masstotal; - for (int i = 0; i < onemols[imol]->natoms; i++) { onemols[imol]->x[i][0] -= onemols[imol]->com[0]; onemols[imol]->x[i][1] -= onemols[imol]->com[1]; @@ -1219,7 +1224,7 @@ void FixGCMC::attempt_molecule_insertion() for (int i = 0; i < natoms_per_molecule; i++) { if (procflag[i]) { - atom->avec->create_atom(ngcmc_type+onemols[imol]->type[i],atom_coord[i]); + atom->avec->create_atom(onemols[imol]->type[i],atom_coord[i]); int m = atom->nlocal - 1; // add to groups @@ -1823,7 +1828,7 @@ void FixGCMC::attempt_molecule_insertion_full() xtmp[1] >= sublo[1] && xtmp[1] < subhi[1] && xtmp[2] >= sublo[2] && xtmp[2] < subhi[2]) { - atom->avec->create_atom(ngcmc_type+onemols[imol]->type[i],xtmp); + atom->avec->create_atom(onemols[imol]->type[i],xtmp); int m = atom->nlocal - 1; // add to groups