Delete atom if distance from another atom is larger than a given number

Hi everyone,

I’m writing a code where I have bonds between pairs (for example, A1 is bonded with B1, A2 with B2, etc.) and I’d like to eliminate either one or both of the atoms {A1,B1} when the distance between them is greater than a given number. How can I do this?

I was thinking on using the delete_atoms function but it seems to work when

the distance is less than a given number. Has the opposite function been performed?

Thanks a lot!

i think the “if command” in the lammps manual can help you. have a try and good luck!

Fix bond/break and bond_style quartic both have bond breaking
capabilities. Also you can look at the peridynamics pair style
(package PERI) which break bonds.

Steve

I actually don’t want to erase the bond but I want to erase either one or the two particles because in my system, once the distance is higher than a certain value, the force and potential are really big and I get the lost atom message

I actually don't want to erase the bond but I want to erase either one or
the two particles because in my system, once the distance is higher than a
certain value, the force and potential are really big and I get the lost
atom message.

that sounds to me like a bad idea. have you considered how much of a
recoil this atom removal will cause?
there seems to be something very wrong in your model. just doing
things in the hope to silence LAMMPS errors/warnings without any
physical justification is almost always trying to cure the symptom and
not the cause.

axel.

Hi Axel! I’m studying the escape of a particle over a cubic potential. Imagine it has a minimum at x=0 and a maximum at x=1.

After x=1 my particle will just drop over the potential, going to - infinity and hence providing an atom lost message.

In the end, I just decided to break the bond after x=1 and let the particle diffuse as it wants

Hi Axel! I'm studying the escape of a particle over a cubic potential.
Imagine it has a minimum at x=0 and a maximum at x=1.
After x=1 my particle will just drop over the potential, going to - infinity
and hence providing an atom lost message.
In the end, I just decided to break the bond after x=1 and let the particle
diffuse as it wants

this is in contradiction with what you were previously saying and what
you say *still* sounds like either a badly designed or badly
implemented model.

axel.

I think you would have to write a fix that

looped over bonds, found any that are “too long”

and deleted an atom. You’d also have to delete

the bond (if owned by the other atom).

And you’d have to make sure that if the two

atoms in the bond are on different procs, they

consistently agree on which atom should be deleted.

Steve