create atoms

Dear lammps users,

I have a simple question, the input script for creating atoms:

boundary p p p

units metal

atom_style atomic

lattice fcc 3.524 origin 0 0 0 orient x -2 1 1 orient y 0 -1 1 orient z 1 1 1

region box block 0 {length} 0 {height} 0 100 units box

create_box 1 box

region myreg block 0 {length} 0 {height} $a $b units box

create_atoms 1 region myreg

My question is when I change $a and only create 3 layers of atoms, I created different lowest layers among C1, C2, and C3, but I use “units box”, which only set the region boundaries, shouldn’t I always create the same layer?

How can I achieve this goal in lammps?

Any help will be appreciated.

Best wishes,


The lattice command defines a fixed 3D array of points which are the possible positions of atoms. Your region myreg command defines a subregion of the box lying between $a and $b. Atoms are created on the subset of lattice points lying in this subregion. $a does not affect the lattice positions; it only affects which lattice points are included in the subset.