hi,

this is mostly an fyi since I don’t know how to fix it.

If you set the set type/frac to create one group and then apply the set type/frac to this new group with the *same* seed you can get odd results e.g. all atoms are set to the last type regardless of the specified fraction (see below for details).

changing the seed gets closer to the expected result but, as the man pages state, a 50% 50% split is not guaranteed. Since I need this for charge neutrality does anyone else have a method in lammps to set exactly half of a group to a new type?

thanks,

Reese

set group FLUID type/fraction 3 0.101 13156

Setting atom values …

194 settings made for type/fraction

group CHARGED type 3

194 atoms in group CHARGED

#set group CHARGED type/fraction 4 0.5 123

set group CHARGED type/fraction 4 0.5 13156

Setting atom values …

194 settings made for type/fraction

group POSITIVE type 3

0 atoms in group POSITIVE

group NEGATIVE type 4

194 atoms in group NEGATIVE

variable cC equal count(CHARGED)

variable cPOS equal count(POSITIVE)

variable cNEG equal count(NEGATIVE)

print “charged {cC} positive {cPOS} negative ${cNEG}”

charged 194 positive 0 negative 194