LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Problem with mapping atoms in custom LJ potential
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Problem with mapping atoms in custom LJ potential

From: Axel Kohlmeyer <akohlmey@...24...>
Date: Tue, 27 Jun 2017 07:47:32 -0400

On Tue, Jun 27, 2017 at 6:34 AM, Ankit Gupta <ankitgupta.mme@...24...> wrote:
Dear LAMMPS users,

I am trying to implement a version of LJ potential for coarse grained simulation which doesn't have any corrugation artifact produced as a result of coarse graining a line into atoms. The basic algorithm is similar to pair_style line/lj  but  is implemented for atoms instead of lines.

In order to calculate lj potential between atoms i and j, I need orientation of each atom with respect to the adjacent atoms. It can be easily extracted if I can access the coordinates of adjacent atoms (i-1, i+1 & j-1, j+1). 

I am implementing it as follows: 
1) get global id of local atom i by tag[i]. 
2) calculate global ids of adjacent atoms as tag[i]+1 and tag[i]-1
3) convert global ids to local ids, m and n, as atom->map(tag[i]+1) & atom->map(tag[i]-1).
4) obtain images of m and n  closest to i as domain->closest_image(i,m) & domain->closest_image(i,n).
5) repeat same process for atom j.

The code works fine in serial version. But it crashes after running for some time step in parallel implementation with exit code 11. I tried changing several parameters. The only thing that worked was changing neighbour skin distance from 2 to 20 A. But it increases the computation cost significantly. 

It will be very helpful if you can kindly let me know what might cause such error. I am using LAMMPS version dated 17Nov16. My system size is roughly 400,000 atoms. The cutoff for lj potential is 28 A and the style of atoms is angle with 10 A and 180 degrees as equilibrium bond length and angle.

​you will get ​a segmentation fault, when the atom->map() function returns a -1 because the requested atom is neither a local atom nor a ghost atom. in serial execution all atom ids are local, so atom->map() will never return -1 for a valid tag. in parallel execution

​i am confused by your use of the term "adjacent". your algorithm looks for atoms with neighboring atom ids; what in your setup keeps those atoms​ close to each other? what happens for atoms that have tag 1 or the last tag, i.e. where there is no atom->tag[i]-1 or atom->tag[i]+1?



Thanks & Regards,
Ankit Gupta

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
lammps-users mailing list

Dr. Axel Kohlmeyer  akohlmey@...12...24...
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.