# -*-shell-script-*-
# Silicon nano wire is constructed
setnolog
setoverwrite
dirname = runs/sinw_15D_tersoff_40pstrain
#dirname = runs/sinw_5D_tersoff_300K
#dirname = runs/temp
#dirname = runs/sinw_15D_sw_nostrain_300K
#shmsize = 31457280 shmallocate #10MB
#------------------------------------------------------------
#Read in configuration file
#incnfile = ~/Codes/MD++/structures/sigenw/sigenw-5nm-fixbox.cn readcn
#incnfile = "~/Codes/MD++/runs/sinw_5D_tersoff_nostrain_300K/initial4MD.cn" readcn
incnfile = "~/Codes/MD++/runs/sinw_15D_tersoff_nostrain/relaxed.cn" readcn
#incnfile = "~/Codes/MD++/runs/sinw_5D_sw_nostrain/relaxed.cn" readcn
#incnfile = "~/Codes/MD++/runs/sinw_15D_tersoff_nostrain_long/relaxed.cn" readcn
#incnfile = relaxed.cn readcn
#--------------------------------------------
# Create Perfect Lattice Configuration
#
latticestructure = diamond-cubic
latticeconst = 5.430949821 #(A) for Si
#latticeconst = 5.65362106225 #(A) for Ge
# Si(1-x)Ge(x) 5.431+0.20x+0.027x^2 (at 300K)
#
#makecnspec = [ 0 0 1 25 
#               1 -1 0 18 
#               1 1 0 13 ] # D = 5nm L = 10nm
#makecnspec = [ 0 0 1 25 
#               1 -1 0 18 
#               1 1 0 6 ] # D = 5nm L = 5nm
makecnspec = [ 0 0 1 74 
              1 -1 0 52 
               1 1 0 20 ] # D = 5nm L = 50nm
#makecn finalcnfile = perf.cn writecn #eval
#--------------------------------------------
# make a cylinder
#
mkcylinderspec = [3 2  # zind yind /* 1x/2y/3z */
                  0 0  # center of circle in reduced coordinate
                  26 ]   # radius of circle (A) for d=5nm
#                  54 ]   # radius of circle (A) for d=10nm
#                  79 ]   # radius of circle (A) for d=15nm
#makecylinder finalcnfile = cylinder.cn writecn eval
#
mkcylinderspec = [3 2  # zind yind /* 1x/2y/3z */
                  0 0  # center of circle in reduced coordinate
                  16   # radius of circle (A)
                  1 ]  # if flag=1, fix atoms outside of circle radius.
#makecylinder finalcnfile = cylinder.cn writecn
#speciesspec = 1 setfixedatomsspecies freeallatoms
#nspecies = 2 element0 = Si element1 = Ge 
eval
#--------------------------------------------
# Plot Configuration
#
atomradius = [ 0.67 0.78 ] bondradius = 0.3 bondlength = 0 #2.8285 #for Si
win_width = 600 win_height = 400
atomradius = 0.9 bondradius = 0.3 bondlength = 0 #2.8285 #for Si
atomcolor = orange atomcolor1 = gray80 highlightcolor = purple  bondcolor = red
fixatomcolor = yellow backgroundcolor = gray70
#atomcolor = lightgrey highlightcolor = purple  bondcolor = darkgrey
#highlightenergy = [ 1 -3 ]
highlightenergy = [ 1 -3.80 ]
#highlightenergy = [ 1 -3.90 ] #SiGe
#hideatomenergy = [ 1 -3.80 1 ]
#plot_select = 1 # reduced coordinates of atoms
#plot_select = 2 # real coordinates of atoms
plot_select = 3 # energy of atoms
plot_highlight = [ 0 0 1 2 3 4 5 6 7 8 9 ]
plotfreq = 10
rotateangles = [ 0 0 0 1.9 ]
#openwin alloccolors rotate saverot refreshnnlist plot
openwin reversergb alloccolors rotate saverot refreshnnlist plot
#------------------------------------------------------------
# apply strain
#shiftspec = [ 3 3 0.008 ] shiftbox
#shiftspec = [ 3 3 0.008 ] shiftbox
#shiftspec = [ 3 3 0.009 ] shiftbox
#shiftspec = [ 3 3 0.01 ] shiftbox
#shiftspec = [ 3 3 0.04 ] shiftbox
#shiftspec = [ 3 3 0.03 ] shiftbox
#shiftspec = [ 3 3 0.04 ] shiftbox
#shiftspec = [ 3 3 0.05 ] shiftbox
#shiftspec = [ 3 3 0.06 ] shiftbox
#shiftspec = [ 3 3 0.07 ] shiftbox
#shiftspec = [ 3 3 0.08 ] shiftbox
#shiftspec = [ 3 3 0.09 ] shiftbox
#shiftspec = [ 3 3 0.10 ] shiftbox
#shiftspec = [ 3 3 0.15 ] shiftbox
#shiftspec = [ 3 3 0.20 ] shiftbox
#shiftspec = [ 3 3 0.25 ] shiftbox
shiftspec = [ 3 3 0.40 ] shiftbox
#------------------------------------------------------------
#Conjugate-Gradient relaxation
conj_ftol = 2e-4 conj_itmax = 1000 conj_fevalmax = 1000
#conj_fixbox = 0 # no strain 
conj_fixbox = 1 # with strain
#conj_monitor = 1 conj_summary = 1
eval relax 
eval # evaluate potential energy after relaxation
writeall=1 
finalcnfile = relaxed.cn writecn
#-------------------------------------------------------------
#convert cn files into atomeye cfg files
finalcnfile = relaxed.cfg writeatomeyecfg 
#
sleep quit
#-------------------------------------------------------------
#MD setting
T_OBJ = 300 #(in K) # Desired Temperature
atommass = 28.0855 # (g/mol) for Si 
#atommass = 72.59 # (g/mol) for Ge 
# molar mass is from http://www.noblemind.com
timestep = 0.0005 # (ps)
DOUBLE_T = 1 # to get T_OBJ as initial condition
#DOUBLE_T = 0 # something strange for sw potential
# otherwise, temperature will become around half of T_OBJ
#initvelocity # Initialize velocity of particles according to T_OBJ 

#for equilibration
#-------------------------------------------------------------
#potavgfreq = 100 # How frequently calculate time avg. potential
equilsteps = 0  totalsteps = 2000 # (ps)
#equilsteps = 0  totalsteps = 4000 # (ps)
plotfreq = 100
# showavgpot = 1 # no such variable in source code
#saveprop = 0 
#saveprop = 1 savepropfreq = 100 outpropfile = equiprop.out 
#openpropfile 
# output properties are just like:
# current step, Kinetic E., Potential E., pressure, stress xy, 
# stress yz, stress zx, total stress, HELM, HELMP, 
# temperature, zeta, dE/dlambda
#savecn = 1 savecnfreq = 100 openintercnfile
#run
#writeall=1 finalcnfile = initial4MD.cn writecn
#eval sleep quit
#------------------------------------------------------------
#Typical MD Simulation
#
#atomTcpl = 200.0 # Atomic T-coupling constant
#boxTcpl = 20.0   # Wall T-coupling constant
#both variables for temperature coupling constraints for velocity scaling.
#But boxTcpl has not yet been implemented in the code
usenosehoover = 1  vt2 = 1e28 #2e28 1e28 #0.5e28
#stress = [ 0 0 0
#           0 0 0
#           0 0 0 ]
#totalsteps = 2000000 # total number of steps
totalsteps = 1000 # total number of steps
timestep = 0.0005 # (ps)
equilsteps = 0 
applyshear = 1
shearrate = [0 0 0
             0 0 0
             0 0 3e-5]                                                                          
#scalevelocity = 1
#scalevelocity = 0  timestep = 0.0005 #precision runs
# if scalevelocity = 1 and usenosehoover = 0,
# then do velscaler()
#autowritegiffreq = 40 # the frequency at which lock and wait for writegif
#wintogglepause
#boundaryspeed = 0  totalsteps = 2000 run finalcnfile = stop.cn writecn
saveprop = 1 savepropfreq = 100 
#outpropfile = prop.out openpropfile
# if saveprop =1, then save pf file with the frequency of savepropfreq after equilsteps
#savecn = 1 savecnfreq = 5000 openintercnfile
savecn = 1 savecnfreq = 200 # 200 steps = 200*(time step) = 0.1 ps ~ 3*10^-4% strain
#openintercnfile
#savecn = 0 savecnfreq = 2000 openintercnfile
# if savecn =1, then save cn file with the frequency of savecnfreq after equilsteps
#findcorefreq = 100 # variable not defined
#run  finalcnfile = run.cn writecn
#relax finalcnfile = relaxed.cn writecn
#eval sleep quit

