# [lammps-users] Stacking Fault Energy - Setup of Particles

Dear Mailinglist,

Yesterday night I found the solution. Setting up the box with basis leads to lost particles. Therefore it is not possible to measure the stacking fault energy as a function of the lattice displacement smoothly. Using displace_atoms for a common lattice it works nicely. I attached the updated script below.

Nevertheless I’m wondering about the algorithm for placing the atoms inside of the simulation box. Why does a different basis(-center?) not include the periodic boundaries? Or what else is the reason for the deviation in natoms if I create a displaced lattice with lattice … basis …?

Best regards:
Gerolf

******* SCRIPT *******
boundary p s p

units metal
atom_style atomic

lattice fcc 3.615 orient x 1 1 -2 orient y 1 1 1 orient z 1 -1 0

variable normal equal 5
variable lateral equal 10
variable llo equal 0
variable lhi equal {normal} variable dy equal div(1,3) # keine überschneidungen variable mlo equal add({lhi},{dy}) variable mhi equal add(add({mlo},{normal}),{dy})
region lower block 0 {lateral} {llo} {lhi} 0 {lateral} units lattice
region middle block 0 {lateral} {mlo} {mhi} 0 {lateral} units lattice
variable bspc equal 5
variable blatlo equal sub({lateral},{bspc})
region box union 2 lower middle
create_box 2 box

create_atoms 1 region lower
group lower region lower

#variable dx equal .5
variable dz equal 0
log log-x\${dx}-z\${dz}

create_atoms 2 region middle
group middle region middle

mass * 63.55
pair_style eam/alloy/opt
pair_coeff * * Cu_Mishin1.eam Cu Cu

displace_atoms middle move {dx} NULL {dz} units box

thermo 1
#variable s0 equal 0
variable sunit equal 16021.765
variable s equal sub(mult(div(etotal,mult(lx,lz)),{sunit}),{s0})
compute s all variable s
compute x all variable dx
compute z all variable dz
thermo_style custom c_x c_z lx ly lz etotal c_s temp step atoms pyy
thermo_modify format float %5.5f

fix notlateralforce all setforce 0 NULL 0

minimize 1e-20 1e6 1e6
******* SCRIPT *******

If you use create_atoms w/out the region option it will
do the right thing at periodic boundaries (one atom on either side).

If you use region, then it compares atoms to the region
boundary w/out paying attention to the periodic boundary.
So you may have to tweak the region size to get exactly
the atoms you want.

Steve