sputter example with prior equilibration in NPT

I have a question regarding the change_box command with respect to sputtering. If I follow the sputter example, I can get it to work fine for many materials that I want to simulate, as long as I just run the NVE command as in the example.

If I want to equilibrate the sample first in NPT ensemble, I need to use periodic boundary conditions in all 3 directions. However, the sputtering needs to take place with only x and y specified as periodic boundaries. So after NPT I switch the BC’s back to what they need to be:

change_box all boundary p p f

But when I switch back to NVE ensemble, and use the deposit command, I get an error saying the deposition region is outside the simulation box.

When I change the boundary conditions, is my simulation box losing information that I had entered earlier? I have tried many different deposit regions, but I keep getting the same error.

Ben

I have a question regarding the change_box command with respect to
sputtering. If I follow the sputter example, I can get it to work fine for
many materials that I want to simulate, as long as I just run the NVE
command as in the example.

If I want to equilibrate the sample first in NPT ensemble, I need to use
periodic boundary conditions in all 3 directions. However, the sputtering
needs to take place with only x and y specified as periodic boundaries. So
after NPT I switch the BC's back to what they need to be:

change_box all boundary p p f

But when I switch back to NVE ensemble, and use the deposit command, I get
an error saying the deposition region is outside the simulation box.

When I change the boundary conditions, is my simulation box losing
information that I had entered earlier? I have tried many different deposit
regions, but I keep getting the same error.

​you *can* run fix npt with not all directions set to periodic boundaries,
only directions that are coupled to fix npt need to be periodic.
in fact for a slab system, it doesn't make sense to relax the supposed to
be non-periodic direction anyway.

axel. ​

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

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.

​fix npt will change the box dimensions, so you should just define all
regions used to define the deposition region *after* your are done with the
fix npt relaxation, or define them small enough, so they will be guaranteed
to be inside the box.

axel.

Hmmm, even when I create the regions to be tiny after NPT, such as below, I still get that the deposition region extends outside the simulation box. I know my simulation box is much larger. Even the tiniest region inside the box yields the error.

region box2 block 0.0 5 0.0 5 -1.0 5.0 units lattice

region sphere sphere 1 1 1 1 units lattice
region insert intersect 2 box2 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

Axel, thanks I think I may have found the mistake. My lower bound had shifted, sorry I was just checking my upper bounds. Thanks for the help.

Axel, sorry again for another question. If I do run the NPT command first, redefine my regions etc. I get past the error I was having, but then the simulation just hangs after the first time step. It says “0 atoms in group insert” so I would assume that there aren’t any overlapping atoms. Would a hanging run be indicative or any type of error I am not aware of? Or is more likely just a computer issue?

Ben

Axel, sorry again for another question. If I do run the NPT command first,
redefine my regions etc. I get past the error I was having, but then the
simulation just hangs after the first time step. It says "0 atoms in group
insert" so I would assume that there aren't any overlapping atoms. Would a
hanging run be indicative or any type of error I am not aware of? Or is
more likely just a computer issue?

​i am too confused at this point. and i haven't your input memorized, so i
don't really know what is going on.

axel.​