# first try with namd

# inputs
coordinates = cnt_wb.pdb
structure   = cnt_wb.psf 
outputname  = cnt_min-heat-2020 

#paraTypeXplor off
paraTypeCharmm on
parameters ../toppar_c36_jul20/par_all36m_prot.prm
#parameters par_all27_prot_lipid.prm
#parameters ../toppar_c36_jul20/par_all36_prot.prm
#parameters ../toppar_c36_jul20/par_all22_prot.prm
mergeCrossterms yes
parameters ../toppar_c36_jul20/par_all36_lipid.prm
parameters ../toppar_c36_jul20/par_all36_carb.prm
parameters ../toppar_c36_jul20/par_all36_na.prm
parameters ../toppar_c36_jul20/par_all36_cgenff.prm
#parameters ../toppar_c36_jul20/par_all35_ethers.prm
#parameters PEG-GO.inp
parameters ../toppar_c36_jul20/toppar_water_ions-cmt.str



DCDfile = cnt_min-heat-2020.dcd
DCDfreq = 1000
restartname = cnt_min-heat-2020
restartfreq = 1000
outputEnergies = 1000
outputTiming = 1000

wrapWater            on
wrapNearest          off

temperature   310  # to be commentend next time, when restarting from .vel
timestep = 1.0
stepspercycle = 20


cutoff = 12.0
switching on
switchdist = 10.0
pairlistdist = 14.0
splitPatch = hydrogen
hgroupCutoff = 2.5
#pairlistsPercycle = 10
exclude = scaled1-4
COMmotion no
dielectric 1.0
1-4scaling 1.0

rigidBonds = all #SHAKE on
useSettle on # faster than SHAKE algorithm on water

fullElectFrequency = 1
nonbondedFreq = 1 

MTSAlgorithm verletI
longSplitting c1


cellBasisVector1     27.2   0.   0.0
cellBasisVector2     0.0 27.1 0.0
cellBasisVector3     0.0    0.0   40.7
cellOrigin          0.0   0.0  10.0
PME                 yes
PMEGridSpacing      1.0



set temp 310
langevin        on
langevinTemp  $temp
langevinDamping      2

#fixedAtoms on 
#fixedAtomsForces on 
#fixedAtomsFile constraint2.pdb 
#fixedAtomsCol B 


constraints on 
consexp    2
consref   constraint.pdb
conskfile constraint.pdb
conskcol    B
constraintScaling 5
minimize 4000
constraintScaling 2
minimize 1000
constraintScaling 1
minimize 1000
constraintScaling 0
minimize 1000
#end minimization

constraintScaling 1
#heating
for {set i 25} {$i <325} {incr i 25} {
set tempr $i
langevinTemp $tempr
reinitvels $tempr
run 1000 
}
#end heating 

#MD run
set temp        310
firsttimestep   0 
reinitvels    $temp
langevinTemp  $temp
useGroupPressure     yes

#useFlexibleCell      yes
#useConstantArea       yes
#LangevinPiston       on
#LangevinPistonTarget 1
#LangevinPistonPeriod 200
#LangevinPistonDecay  100
#LangevinPistonTemp   $temp

run 95000 


