# PREREQUISITES:
#
#   1) You must use moltemplate.sh to create 3 files:
#        system.data  system.in.init  system.in.settings
#     (Follow the instructions in README_setup.sh, or run it using ./README_sh.)
#   2) You must equilibrate the system beforehand using "run.in.npt".
#      This will create the file "system_after_npt.data" which this file reads.
#      (Note: I have not verified that this equilibration protocol works well.)
#
# -------- LAMMPS 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 -------------------


# Read the coordinates generated by an earlier NPT simulation

read_data       system_after_npt.data

# (The "write_restart" and "read_restart" commands were buggy in 2012, 
#  but they should work also.  I prefer "write_data" and "read_data".)


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

include         system.in.settings

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


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


thermo_style  custom step temp pe etotal vol epair ebond eangle
thermo        1000  # 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.

#restart       500000

run           50000000


write_data   system_after_nvt.data

# (The "write_restart" and "read_restart" commands were buggy in 2012, 
#  but they should work also.)