# -------- REQUIREMENTS: ---------
# 1) This example requires the "USER-MISC" package.  (Use "make yes-USER-MISC")
#   http://lammps.sandia.gov/doc/Section_start.html#start_3
# 2) It also may require additional features and bug fixes for LAMMPS.
#   So, after typing "make yes-user-misc" in to the shell, ...
#   be sure to download and copy the "additional_lammps_code" from 
#   http://moltemplate.org     (upper-left corner menu)
# 3) Unpack it
# 4) copy the .cpp and .h files to the src folding of your lammps installation.
# 5) Compile LAMMPS.
#
# If LAMMPS complains about an "Invalid pair_style", or "Invalid dihedral_style"
# then you made a mistake in the instructions above.
#
# ------------------------------- Initialization Section --------------------

include         system.in.init

# ------------------------------- Atom Definition Section -------------------

# Commenting out:
#
# read_data       system.data
#
# Instead read the restart file created by "run.in.min".

read_restart    system_after_min.rst

# WARNING: Unfortunately the LAMMPS "read_restart" command has been undependable
# over the past year (2012).  If this fails, then just move the minimization
# steps in run.in.min into this script (into the "Run Section").
# Alternately, try to extract the last frame of the dump file created
# by run.in.min using "read_dump", "dump2data.py", and/or "restart2data".

# ------------------------------- Settings Section --------------------------

include         system.in.settings

# ------------------------------- Run Section -------------------------------

# Just in case the previous minimization failed, try again.
# (I don't know why this would help, but sometimes loading
#  up the restart file and trying again does help.  Magic.)

minimize 1.0e-5 1.0e-7 5000 20000

# Run main simulation

timestep      10.0  # The time-step in Watson et. al 2011 was 0.002*3ps = 6fs
dump          1 all custom 2500 traj_nvt.lammpstrj id mol type x y z ix iy iz


thermo_style  custom step temp pe etotal vol epair ebond eangle
thermo        100  # time interval for printing out "thermo" data




fix fxlan all langevin 300.0 300.0 120 48279
fix fxnve all nve

# Note: The energy scale "epsilon" = 2.75kJ/mole = 330.7485200981 Kelvin*kB.
#       So a temperature of 300.0 Kelvin corresponds to 0.907033536873*epsilon.
# Note: The langevin damping parameter "120" corresponds to 
#       the 0.12ps damping time used in Watson et. al JCP 2011.

run           1000000

write_restart system_after_nvt.rst

