displacement

Hello
I have a question about the displacement of atoms:
I want to return atom’s position to coordinate center after relaxation through displacing them but this does not work or only work for specific replication of atom’s lattice (i.e. 333). I appreciate any help.

This is my code:

units metal
dimension 3
atom_style atomic
boundary p p p
atom_modify map array
timestep 1e-3

lattice fcc 4.07

region box block 0.0 1.0 0.0 1.0 0.0 1.0
create_box 1 box
create_atoms 1 region box
mass 1 196.97
replicate 4 4 4

#pair_style meam

#pair_coeff * * library.meam Au NULL Au
pair_style eam
pair_coeff * * Au_u3.eam

velocity all create 0.1 511124 units box

fix relax all nvt temp 0.1 0.1 0.01
thermo 1000
thermo_style custom step temp pe
dump relax_position all xyz 5000 dump2.xyz
run 5000
undump relax_position
unfix relax

thermo_style custom fmax fnorm
min_style cg
minimize 0 0 1000 1000000

compute xmin all reduce min x
compute xmax all reduce max x
compute ymin all reduce min y
compute ymax all reduce max y
compute zmin all reduce min z
compute zmax all reduce max z

variable xmin equal c_xmin
variable xmax equal c_xmax
variable ymin equal c_ymin
variable ymax equal c_ymax
variable zmin equal c_zmin
variable zmax equal c_zmax

thermo_style custom v_xmin v_xmax v_ymin v_ymax v_zmin v_zmax pe
thermo 1
dump position1 all xyz 1 dump5.xyz #For having video!
run 1
undump position1

variable zminscale equal -v_zmin
displace_atoms all move 0 0 ${zminscale} units box

compute x1min all reduce min x
compute x1max all reduce max x
compute y1min all reduce min y
compute y1max all reduce max y
compute z1min all reduce min z
compute z1max all reduce max z

variable x1min equal c_x1min
variable x1max equal c_x1max
variable y1min equal c_y1min
variable y1max equal c_y1max
variable z1min equal c_z1min
variable z1max equal c_z1max

thermo_style custom v_x1min v_x1max v_y1min v_y1max v_z1min v_z1max pe
dump position2 all xyz 1 dump6.xyz
run 1
undump position2

variable yminscale equal -v_y1min
displace_atoms all move 0 v_yminscale 0 units box

compute x2min all reduce min x
compute x2max all reduce max x
compute y2min all reduce min y
compute y2max all reduce max y
compute z2min all reduce min z
compute z2max all reduce max z

variable x2min equal c_x2min
variable x2max equal c_x2max
variable y2min equal c_y2min
variable y2max equal c_y2max
variable z2min equal c_z2min
variable z2max equal c_z2max

thermo_style custom v_x2min v_x2max v_y2min v_y2max v_z2min v_z2max pe
dump position3 all xyz 1 dump6.xyz
run 1
undump position3

variable xminscale equal -v_x2min
displace_atoms all move ${xminscale} 0 0 units box

compute xxmin all reduce min x
compute xxmax all reduce max x
compute yymin all reduce min y
compute yymax all reduce max y
compute zzmin all reduce min z
compute zzmax all reduce max z

variable xxmin equal c_xxmin
variable xxmax equal c_xxmax
variable yymin equal c_yymin
variable yymax equal c_yymax
variable zzmin equal c_zzmin
variable zzmax equal c_zzmax

thermo_style custom v_xxmin v_xxmax v_yymin v_yymax v_zzmin v_zzmax pe
thermo 1
dump position all xyz 1 dump4.xyz #For having video!
run 1
undump position
1

run 1

You’ll have a better chance of getting help if you post as simple as possible

an input script that highlights exactly what the issue/question is.

Steve