changing the atom type of those atoms that meet a certain condition during a run

Dear LAMMPS users,

I have a question regarding changing the atom types of a number of atoms in a group, during the simulation run, if they meet a certain condition.

I am simulating the contact of two rough substrates by applying different load values. Because of the surface roughness, the contact is distributed all over the surface, and the contacting atoms would increase at higher loads. What I need to do is to identify the contacting atoms and constrain their movement in 1D, instead of 3D. For changing the behavior of the atoms I think once the contacting atoms are identified, it would be possible to change their type, where the new atom type has the needed constrains.
The contacting atoms can be identified with either of two criteria, which are based on the distances between the contacting atoms, and based on the potential energy values of the atoms. The process of this identification, however, is puzzling me. Is it possible to somehow use the “if command” for that? Or, is there any other possible/available way?

With thanks,
Soheil

Dear LAMMPS users,

I have a question regarding changing the atom types of a number of atoms
in a group, during the simulation run, if they meet a certain condition.

I am simulating the contact of two rough substrates by applying different
load values. Because of the surface roughness, the contact is distributed
all over the surface, and the contacting atoms would increase at higher
loads. What I need to do is to identify the contacting atoms and constrain
their movement in 1D, instead of 3D. For changing the behavior of the atoms
I think once the contacting atoms are identified, it would be possible to
change their type, where the new atom type has the needed constrains.
The contacting atoms can be identified with either of two criteria, which
are based on the distances between the contacting atoms, and based on the
potential energy values of the atoms. The process of this identification,
however, is puzzling me. Is it possible to somehow use the "if command" for
that? Or, is there any other possible/available way?

​no, the "if" command cannot be used for that kind of stuff. if is a global
branching feature that can be used to decide whether a specific command is
issued or something else or not, it cannot be used to branch on per-atom
properties.

to dynamically change the atom type during a run, you would have to write a
custom new fix style. however, changing the atom type during the run of a
simulation is ​a non-trivial operation. ...and i don't think it is really
needed. it would probably be sufficient (and simpler to implement) to have
your fix collect the necessary information (e.g. through requesting and
looping over a neighbor list), then maintain a per-atom flag that
determines on post processing atom properties (e.g. forces) and apply them
in the post_force() step.

axel.