add a periodic force to each individual atoms

Dear Lammps users,

I have some difficulties to add force to atoms in my simulated system. Specifically, What i intent to do is to add a time dependent periodic force describing by a sin() function to each atoms in the system, the magnitude of this force varys among individual atoms, and depends on interatomic distances of all the atoms. (It’s actually called Driven Molecular Dynamics (DMD)) I have tried with fix addforce, but it required each atoms to be included in an individual group, and lammps doesn’t allow me to create too many groups. I am wondering is there other simple ways to add such a force to atoms?

Also the since the magnitude of this force depends on interatomic distances of all atoms, the way i calculate it is using a double loop, loop over all the atoms , can i reassign a value to a variable, like what people do in other programming language.

variable sum equal v_sum+a

Thanks in advance for any help!!!

Best Regards

Jiasen Guo

Dear Lammps users,

I have some difficulties to add force to atoms in my simulated system.
Specifically, What i intent to do is to add a time dependent periodic force
describing by a sin() function to each atoms in the system, the magnitude
of this force varys among individual atoms, and depends on interatomic
distances of all the atoms. (It's actually called Driven Molecular
Dynamics (DMD)) I have tried with fix addforce, but it required each
atoms to be included in an individual group, and lammps doesn't allow me to
create too many groups. I am wondering is there other simple ways to add
such a force to atoms?

​it depends on whether it can be computed with atom style variables. from
your description it is not possible to say if this applies here.​

​ most likely not.​

Also the since the magnitude of this force depends on interatomic
distances of all atoms, the way i calculate it is using a double loop, loop
over all the atoms , can i reassign a value to a variable, like what
people do in other programming language.

​no. the LAMMPS scripting language is not a regular programming language.
looping on the script level is a global, and not parallel operation. what
you describe defeats the purpose of using a parallel program and is very
slow and inefficient.

it is not really clear from your description, e.g. what "interatomic
distance of all the atoms" means.​

​i think a meaningful approach requires C++ programming. what you describe
sounds like it has some similarity with Targeted MD, so you may want to
have a look at the fix tmd​ source code.

​axel.​