# -*-shell-script-*-
# MD++ input script
# Function: illustrate screw dislocation in a simple cubic lattice
#------------------------------------------------------------
setnolog
setoverwrite
dirname = runs/CSD-book/screw
shmsize = 20971520 shmallocate #20MB
#-------------------------------------------------------------
#Create Perfect Crystal
# a hypothetical simple cubic crystal
latticestructure = simple-cubic latticeconst = 3 #(in Angstrom)
latticesize = [  1   0   0   8
                 0   1   0   8
                 0   0   1   6 ]
makecrystal finalcnfile = perf.cn writecn
#-------------------------------------------------------------
#Cut away boundary atoms
input = [ 1  0.40 10   -10 10 -10 10 ] fixatoms_by_position
input = [ 1  -10 -0.30 -10 10 -10 10 ] fixatoms_by_position
input = [ 1  -10 10 0.45 10   -10 10 ] fixatoms_by_position
input = [ 1  -10 10 -10 -0.35 -10 10 ] fixatoms_by_position
removefixedatoms
#-------------------------------------------------------------
#Remove interior atoms for better visualization
input = [ 1 -10 0.3 -10 0.3 -10 0.1 ] fixatoms_by_position
removefixedatoms
#-------------------------------------------------------------
#Create Dislocation by cut and shift
input = [
             3 1 #z(dislocation line), x(dipole direction)
             0 0 0.166667 #(burgers vector relative to box screw)
             0.0625 -0.4375 0.0625 #(screw)
             0.305 #\nu
             0 0 0 0 0  #number of images
             0 0 0 1 ]
makedipole finalcnfile = makedp.cn writecn
#
# move dislocation to the right
#input = [
#             3 1 #z(dislocation line), x(dipole direction)
#             0 0 0.166667 #(burgers vector relative to box screw)
#             0.0625 0.0625 0.1875 #(screw)
#             0.305 #\nu
#             0 0 0 0 1  #number of images
#             0 0 0 0 ]
#makedipole finalcnfile = makedp.cn writecn
#
# move dislocation down
input = [
             3 2 #z(dislocation line), x(dipole direction)
             0 0 0.166667 #(burgers vector relative to box screw)
             0.0625 -0.0625 0.0625 #(screw)
             0.305 #\nu
             0 0 0 0 1  #number of images
             0 0 0 0 ]
makedipole finalcnfile = makedp.cn writecn
#input = [ 2 3 0.08 ] redefinepbc #shiftbox back
#------------------------------------------------------------
#Remove interior atoms for better visualization
#input = [ 22  8 24 40 56 72  6 22 38 54 70  52 68
#             2 18 34 50 66  0 16 32 48 64 ] fixatoms_by_ID
#removefixedatoms 
#input = [ 21  8 24 40 56 72  6 22 38 54 70
#             2 18 34 50 66  0 16 32 48 64 68 ] fixatoms_by_ID
input = [ 21  8 24 40 56 72  6 22 38 54 70
             2 18 50 66  0 16 32 48 64 52 68 ] fixatoms_by_ID
removefixedatoms
#------------------------------------------------------------
#Plot Configuration
#
atomradius = 0.4 bondradius = 0.04 bondlength = 3.34
atomcolor = orange highlightcolor = purple  bondcolor = gray60 
fixatomcolor = gray80 #red #yellow
win_width = 400 win_height = 400 backgroundcolor = gray70
plot_atom_info = 1 plotfreq = 10 
rotateangles = [ -20 -17 0 1.4 0.5e-3 ]
win_width = 500 win_height = 500
#win_width = 250 win_height = 250
#openwin alloccolors rotate saverot refreshnnlist eval plot
openwin reversergb alloccolors rotate saverot refreshnnlist eval plot
sleep quit
#-------------------------------------------------------------
