# run.in.nvt
#
# --  Usage  --
#
# lmp_g++ -i run.in.nvt
# (assuming lmp_g++ is the name of your lammps binary)
#
# --  Prerequisite Input Files:  --
#   systen.data, system.in.init, system.in.settings, system.in.sw
#
# You can generate these files with this command:
#   moltemplate.sh -a "@atom:/WatMW/mW 1" system.lt
# ---------------------------------


# -- init section --


include system.in.init



# -- atom definition section --

# Normally, I would minimize the system and equilibrate the system at constant
# pressure and temperature beforehand.  If you run lammps with "run.in.npt",
# it will generate a restart file "system_after_npt.rst" with reasonable
# coordinates at that temperature and pressure.  Then we could load it now:
#
#read_restart    system_after_npt.rst
#
# Unfortunately the LAMMPS "read_restart" command has been undependable over
# the past year (2012), and I feel it is safer to remove it from the examples.
# Instead, for this example, I just read the raw coordinates generated by 
# moltemplate (and the default volume).  (I get fewer questions this way.) 
# However you should never run any liquid simulations at constant volume without
# pressure equilibration first.  Hopefully in the future "read_restart" will 
# work.  Otherwise try "read_dump", "dump2data.py", or "restart2data".


read_data       system.data



# -- settings section --


include system.in.settings


# -- run section --


timestep        2.0
dump            1 all custom 1000 traj_nvt.lammpstrj id mol type x y z ix iy iz
dump            2 TraPPE custom 1000 traj_alkane_nvt.lammpstrj id mol type x y z ix iy iz
fix             fxnvt all nvt temp 300.0 300.0 500.0 tchain 1

# The following commands are useful if you want to calculate the distribution 
# of alkane-chain radius-of-gyration at a given temperature & pressure.
#compute cRg TraPPE gyration
#variable vRg equal c_cRg
#compute cPE all pe
#variable vPE equal c_cPE
#fix FprintPE all print 1000 "${vPE}" file U.dat 
#fix FprintRg all print 1000 "${vRg}" file Rg.dat 

thermo_style    custom step temp pe etotal press vol epair ebond eangle edihed
thermo          1000  # time interval for printing out "thermo" data
#thermo_modify  flush yes

restart         100000  restart_nvt

run		1000000

write_restart  system_after_nvt.rst


