[lammps-users] Accessing atoms mass by it's ID

Hi everybody,

I’m writting a fix code for a kind of thermostat and, at a point of the code which is a for loop running over atom’s ID, I need to get information of each atom’s mass. I would like to know how to do this by using it’s ID.



Alexandre, you can see an example in the verlet time integration in the NVE fix.

I presume you really mean you are looping over the local
atoms owned by a processor, name i = 0 to nlocal.

In which case atom->mass[atom->type[i]] is the atom's mass.