#####################################################
#                                                   #
#     j                                          #
# Filename: in.deform.polychain.txt                 #
# Author: Mark Tschopp, 2010                        #
#                                                   #
# The methodology outlined here follows that from   #
# Hossain, Tschopp, et al. 2010, Polymer.  Please   #
# cite accordingly. The following script requires   #
# a LAMMPS data file containing the coordinates and #
# appropriate bond/angle/dihedral lists for each    #
# united atom.                                      #
#                                                   #
# Execute the script through:                       #
# lmp_exe < in.deform.polychain.txt                 #
#                                                   #
#####################################################

# VARIABLES
include typecell
variable fname index ${typecell}conf2.txt    # configuration initiale
#variable fname index ${typecell}conf0.txt    # configuration initiale
variable simname index test

variable namerestfile index final3.xyz
variable namef index dumprest4.${typecell}.comp.dcd
#variable namef index dumpevery10.${typecell}.comp.dcd


shell python check_restart.py ${namef} ${namerestfile}
include nrestart

#package cuda override/bpa 1


# Initialization
#correspond to x=y=z=1
lattice fcc 4
units		lj
boundary	f f f
atom_style	molecular
log 		log.${simname}.txt
read_data	${fname}

# Dreiding potential information
#neighbor	2.0 multi

neighbor 2.0 multi

#neigh_modify	every 10 check yes


include interactions
include variables

#compute csym all centro/atom fcc
#compute peratom all pe/atom 


#####################################################
# Equilibration (Langevin dynamics at 5000 K)

group telo type 2
group norm type 1 2 4 6
group ribo type 3
group centro type 4
group spb  type 5
group particle type 1 2 3 4 6
compute hic particle pair/local dist
compute hicp particle property/local patom1 patom2


#load traj

#read_dump dumpint.yeast.comp.dcd 5 x y z box no format molfile dcd replace yes
read_dump ${namerestfile} 0 x y z box no format xyz
#rerun dumpint.yeast.comp.dcd dump x y z box no 

 
velocity 	particle create 1.0 1231
fix		1 particle nve/limit 0.05
fix		addscale particle langevin 1.0 1.0  ${damp} 904297  scale 3 ${isigrDNA}

########New
#variable damp equal 4

region mySphere sphere 0.0 0.0 0.0 v_frad side in

fix wall1 norm wall/region mySphere lj126 ${eNorm} ${sigNorm} ${sigNormCut} 
fix wall2 ribo wall/region mySphere lj126 ${eRibo} ${sigRibo} ${sigRiboCut}

include spbinteraction

thermo_style	custom step temp 
thermo          10000
timestep	0.005 
#timestep	0.012


variable hbox equal 1.1*${frad}
variable lbox equal -1.1*${frad}
change_box all x final ${lbox} ${hbox} y final ${lbox} ${hbox} z final ${lbox} ${hbox}

fix wall telo wall/region mySphere  lj93  ${etelo} ${sigtelo} ${cuttelo}


reset_timestep ${nrest}
dump Hic all local 1000 dump.hic_*.cfg c_hicp[1] c_hicp[2] c_hic
dump 		1 all dcd 10000 ${namef}
run 100000000 upto
#####################################################
