# -*-shell-script-*-
# MD code of Finnis-Sinclair Mo
#  create grain boundary vicinal to SIGMA-3
setnolog
setoverwrite
dirname = runs/mo-gbvic
#--------------------------------------------
#Read in potential file
#
potfile = ~/Codes/MD++/potentials/mo_pot readpot
#------------------------------------------------------------
#Create Perfect Lattice Configuration
#
# crystal 1
latticestructure = body-centered-cubic latticeconst = 3.1472 #(A) for Mo
latticesize = [ 50  50  48    1
               -11 -11  26    1
                1  -1   0    16  ]
makecrystal finalcnfile = cryst1.cn writecn
#
# crystal 2
latticesize = [ 49   49  -50   1
                13.5 13.5 23.5 1
                1  -1   0    16  ]
makecrystal finalcnfile = cryst2.cn writecn
#-------------------------------------------------------------
#Put two crystals on top of each other
#
# current configuration (in memory) is cryst2.cn
allocmultiple = 2  #anticipating the system size to double
#
# read in cryst1.cn and put it on top of cryst2.cn
incnfile = cryst1.cn input = [ 3 ]  #along z direction
splicecn
finalcnfile = mogbvic-unrelax.cn writecn
#
# read in the new configuration again
allocmultiple = 1 incnfile = mogbvic-unrelax.cn readcn
#-------------------------------------------------------------
#Read in relaxed configuration file (for visualization)
#incnfile = mogbvic-relaxed.cn readcn
#-------------------------------------------------------------
#Plot Configuration
atomradius = 1.0 bondradius = 0.3 bondlength = 0
atomcolor = cyan highlightcolor = purple backgroundcolor = gray
bondcolor = red fixatomcolor = yellow
color00 = "orange"  color01 = "red"    color02 = "green"
color03 = "magenta" color04 = "cyan"   color05 = "purple"
color06 = "gray80"  color07 = "white"
#
# Limit plot to the middle part of the simulation cell
#   (there is another grain boundary at the edge of the simulation cell,
#    comment out the following line to see)
plot_limits = [ 1 -10 10 -10 10 -0.4 0.4 ]
#----------------------------------
#  Use local energy to visualize defects
#plot_color_axis = 0
#plot_color_windows = [ 2
#                       -6.78 -6.7  6  #color06 = gray80
#                       -6.7  -6    4  #color04 = cyan
#                     ]
#----------------------------------
#  Use CSD to visualize defects
plot_color_axis = 2
plot_color_windows = [ 2
                      0.2  1.0    3  #color03 = magenta
                      2.0  20     6  #color06 = gray80
                     ]
#----------------------------------
plot_atom_info = 5  plotfreq = 10 
rotateangles = [ 0 0 0 1.2 ]
#
win_width = 600 win_height = 600
openwin alloccolors rotate saverot refreshnnlist eval plot
#sleep quit
#-------------------------------------------------------------
#Conjugate-Gradient relaxation
conj_ftol = 5e-5 conj_itmax = 1000 conj_fevalmax = 1000
conj_fixbox = 1 
relax finalcnfile = mogbvic-relaxed.cn writecn
#-------------------------------------------------------------
#Plot local energy or CSD parameter histogram
#eval input = [ -6.80 -5  50 ] # min, max, ngrid for energy
eval input = [  0.1  10  50 ] # min, max, ngrid for CSD
#
GnuPlotHistogram 
#-------------------------------------------------------------
sleep
quit
#-------------------------------------------------------------
