I’ve run into trouble with the lammps model I have been running through the python library interface, where lmp.gather_atoms seems to stop operating properly after running an evaporate atoms fix.
I use gather_atoms such to create a numpy array of all the atoms in my group “bilayer” (being atoms with type 1 and 2), via a function as follows:
gath_pos = lmp.gather_atoms(“x”, 1, 3)
gath_pos = np.array(gath_pos).reshape(-1,3)
gath_type = lmp.gather_atoms(“type”, 0, 1)
gath_id = lmp.gather_atoms(“id”, 0, 1)
gath = np.column_stack((gath_id, gath_type, gath_pos))
My code runs absolutely fine up until I use an evaporate fix as follows:
lmp.command(‘fix 4 water_in evaporate 10 9 rsphere 38277 molecule no’)
Which seems to work correctly, reducing the number of particles in my water_in group by about 10% which is what I wanted. However, after this fix my lmp.gather_atoms function fails, just creating a (correctly sized array) of zeros. Lammps seems to correctly recognize that the total number of atoms in the simulation has reduced, but gather_atoms only returns zeros for any of the atom properties I want to extract.