Axel, if I run my code without NPT period, the sputtering deposit command works.
If I run NPT in just x and y, I get the error. Anytime I invoke the NPT command for any time at all, then switch to NVE with deposit command, I get the error.
I am not sure why just running the NPT command for 100 steps, causes the deposition region to be outside the simulation box. And my system isn’t collapsing or anything like that.
The code is below.
surface sputtering demo
#Define settings to run on GPU
package gpu 1 neigh no
suffix off
#Define variables
box length in x and y
variable len index 20.0
height of layer
variable hgt index 8.0
delta between insert area and box
variable len0 index 0.1
full length minus delta
variable len1 equal {len}-{len0}
half length
variable len2 equal ${len}*0.5
timestep 0.0005
variable time_step equal 0.0005
variable f1 equal 0.1/{time_step}
variable f3 equal 10/{time_step}
variable f2 equal {f3}/{f1}
variable tdamp equal {time_step}*100
variable pdamp equal {time_step}*1000
units metal
atom_style atomic
boundary p p f
lattice fcc 4.05
region box block 0.0 {len} 0.0 {len} -1.0 40.0 units lattice
two atom types: surface and sputter atoms
create_box 2 box
region layer block 0.0 {len} 0.0 {len} 0 ${hgt}
create_atoms 1 region layer
mass 1 26.98
mass 2 26.98
region fixed block INF INF INF INF 0.0 0.1
group fixed region fixed
group mobile subtract all fixed
pair_style eam/alloy
pair_coeff * * …/…/Al_zope.eam.alloy Al Al
neighbor 0.3 bin
neigh_modify every 2 delay 6 check yes
velocity mobile create 300 87287
compute mtemp mobile temp
fix 2 all npt temp 300 300 {tdamp} x 1.01325 1.01325 {pdamp} y 1.01325 1.01325 ${pdamp}
run 100
unfix 2
thermo 100
thermo_style custom step atoms temp etotal
thermo_modify temp mtemp
dump id all xyz 200 sputter.xyz
define region for inserting particles
region sphere sphere {len2} {len2} 42.0 ${len2} units lattice
region insert intersect 2 box sphere
define group of inserted particles
group insert region insert
deposit particles regularly into insert volume
fix insert insert deposit 50 2 10 12345 region insert vz -327.535154 -327.535154 &
target 29.8 29.74 ${hgt} units box
neigh_modify every 1 delay 0 check yes
time integrate inserted particles
fix 4 all nve
remove thermostat on layer atoms
variable nlayer equal count(mobile)+count(fixed)
variable ninsert equal count(insert)
thermo_style custom step atoms v_nlayer v_ninsert temp etotal
thermo_modify temp mtemp
handling of atoms the get bounced back from surface
or sputtered off the surface.
thermo_modify lost ignore
run 10000
unfix 1