[lammps-users] A strange problem about boundary condition "S"

Dear All:

Recently, I’ve met a very strange problem when I apply the boundary
condition “S” during parallel computing.

For a very simple example I tested, the boundary condition will be
periodic along x-y plane but a free boundary along z coordinate. The
problem is if I want to create a correct initial structure, I have to
set a appropriate box range along z coordinate.

In the following script, I just want to generate a slab with “10”
Angstrom thickness. If I set the maximum z coordinate of simulation box
as “50” Angstrom, I will not get the correct structure with all atoms
in the “dump” file, however, in the “log” file, you can see it does
create all atoms but part of them are lost in the “dump” file.

If I set the maximum z coordinate of the simulation box as “25”,
everything goes well. I’ve enough atoms in the “dump” file.

Last, the problem happens only when I run it with multiple processors.
If I simply run it with single processor, no matter how I set the range
of the simulation box, it runs well. No problem is aware. Maybe I should
give a appropriate number to the simulation box at the beginning,
however, theoretically, the problem should not happen right? So is it a
bug or I make some mistake in the Lammps script?

(The attached file is the lammps script file and potential energy that I

Lingqi Yang

#---------- Script -------------
units metal
atom_style atomic
boundary p p s

neighbor 2.0 bin
neigh_modify delay 5

timestep 0.002

lattice fcc 3.92
region box block 0 50 0 50 0 25 units box

create_box 1 box

region hi block INF INF INF INF 10 20 units box

create_atoms 1 region hi

group all type 1

pair_style eam/alloy
pair_coeff * * Pt-Au.eam.alloy Pt

thermo 1
thermo_modify lost warn

dump 1 all atom 1 dump.atom
dump_modify 1 scale no

run 1

in.nanoindentation (668 Bytes)

Pt-Au.eam.alloy (369 KB)

This note from the read_data doc page is likely your problem:

IMPORTANT NOTE: If the system is non-periodic (in a dimension), then
all atoms in the data file must have coordinates (in that dimension)
that are "greater than or equal to" the lo value and "less than or
equal to" the hi value. If the non-periodic dimension is of style
"fixed" (see the boundary command), then the atom coords must be
strictly "less than" the hi value, due to the way LAMMPS assign atoms
to processors. Note that you should not make the lo/hi values
radically smaller/larger than the extent of the atoms. For example, if
your atoms extend from 0 to 50, you should not specify the box bounds
as -10000 and 10000. This is because LAMMPS uses the specified box
size to layout the 3d grid of processors. A huge (mostly empty) box
will be sub-optimal for performance and may cause a parallel
simulation to lose atoms the first time that LAMMPS shrink-wraps the
box around the atoms.

I'll add a similar note to the create_box doc page.

Bottom line: create a box that is close to the extent of your atoms.