# -------- 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.



# -- Init section --

include system.in.init

# -- Atom definition section --

read_data system.data

#   If you repeat minimization later, you can skip the (slow) step above which 
#   reads the coordinaes, by commenting it out and uncommenting this line below:
#
# read_restart system_t0.rst

# -- Settings Section --

include system.in.settings

# -- Run section --

write_restart  system_t0.rst

dump            1 all custom 50 traj_min.lammpstrj id mol type x y z ix iy iz

# minimize 

minimize 1.0e-5 1.0e-7 5000 20000

#   If minimization crashes, then instead try Langevin dynamics 
#   with a small timestep and a fast damping parameter.  For example:
#
# timestep 0.05
# fix fxlan all langevin 300.0 300.0 100.0 48279
# fix fxnve all nve
#
# run 10000

write_restart  system_after_min.rst
