Dear LAMMPS users,

recently I was trying to generate diamond lattice, where its 111 plane was rotated to be aligned with the z axis. I used the commands:

units metal

atom_style atomic

boundary p p p

lattice diamond 5.657 orient x -1 1 0 orient y -1 -1 2 orient z 1 1 1

region simbox block 0 4 0 3 0 2

create_box 1 simbox

create_atoms 1 region simbox

It worked, but only partially, i.e., I do not get any lattice mismatches at the boundary, but I am observing many randomly missing atoms at the boundary. It looks like some rounding errors, because if I modify the region command to:

region simbox block 0.001 4.001 0.001 3.001 0.001 2.001

so that the system is shifted by 0.001 in all directions, everything works fine.

I have attached two AtomEye compatible files of the system generated by above described parameters. By checking the coordination numbers of atoms one can see that in case of the file ‘fullSystem300K_0_missing_atoms.cfg’, not every where the number is 4.

Do you have any idea what could be the reason for that? I am using the latest LAMMPS update.

All the best,

Bartosz Liedke

fullSystem300K_0_missing_atoms.cfg (29.2 KB)

fullSystem300K_0_shifted.cfg (32 KB)

Dear LAMMPS users,

recently I was trying to generate diamond lattice, where its 111 plane was

rotated to be aligned with the z axis. I used the commands:

units metal

atom_style atomic

boundary p p p

lattice diamond 5.657 orient x -1 1 0 orient y -1 -1

2 orient z 1 1 1

region simbox block 0 4 0 3 0 2

create_box 1 simbox

create_atoms 1 region simbox

It worked, but only partially, i.e., I do not get any lattice mismatches at

the boundary, but I am observing many randomly missing atoms at the

boundary. It looks like some rounding errors, because if I modify the region

command to:

region simbox block 0.001 4.001 0.001 3.001 0.001 2.001

It is good that you have found the solution.

As to the reason, from Axel's previous post, "do not define your

regions and box boundaries to be located exactly on lattice points -

just shift it a bit and that will easily remove any ambiguity that you

incur otherwise."

Ray

From the create_atoms doc page:

For the *box* style, the create_atoms command fills the entire simulation box with particles on the lattice. If your simulation box is periodic, you should insure its size is a multiple of the lattice spacings, to avoid unwanted atom overlaps at the box boundaries. If your box is periodic and a multiple of the lattice spacing in a particular dimension, LAMMPS is careful to put exactly one particle at the boundary (on either side of the box), not zero or two.

For the *region* style, a geometric volume is filled with particles on the lattice. This volume what is inside the simulation box and is also consistent with the region volume. See the region command for details. Note that a region can be specified so that its “volume” is either inside or outside a geometric boundary. Also note that if your region is the same size as a periodic simulation box (in some dimension), LAMMPS does not implement the same logic described above as for the *box* style, to insure exactly one particle at periodic boundaries. if this is what you desire, you should either use the *box* style, or tweak the region size to get precisely the particles you want.

Steve