| 1 |
# Running LAMMPS on this file (eg. "lmp_mpi -i run.in.npt") minimizes the |
| 2 |
# system (ie. finds the nearest local energy minimum). This is useful to |
| 3 |
# push apart small overlaps between particles that would otherwise cause |
| 4 |
# LAMMPS to crash during a normal simulation run. |
| 5 |
# Do this before anything else. |
| 6 |
# |
| 7 |
# -------- PREREQUISITES: --------- |
| 8 |
# 1) This example requires the "EXTRA-MOLECULE" package. |
| 9 |
# If you encounter the error *"Invalid dihedral_style"*, then see this page: |
| 10 |
# https://lammps.sandia.gov/doc/Build_package.html |
| 11 |
# for instructions to compile LAMMPS to support this package. |
| 12 |
# 2) It also may require additional features and bug fixes for LAMMPS. |
| 13 |
# So, after typing "make yes-user-misc" in to the shell, ... |
| 14 |
# be sure to download and copy the "additional_lammps_code" from |
| 15 |
# http://moltemplate.org (upper-left corner menu) |
| 16 |
# 3) Unpack it |
| 17 |
# 4) copy the .cpp and .h files to the src folding of your lammps installation. |
| 18 |
# 5) Compile LAMMPS. |
| 19 |
# 6) Build the system using PACKMOL and MOLTEMPLATE |
| 20 |
# (Follow the instructions in README_setup.sh, or run that file as a script.) |
| 21 |
# |
| 22 |
# If LAMMPS complains about an "Invalid pair_style", or "Invalid dihedral_style" |
| 23 |
# then you made a mistake in the instructions above. |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
# -- Init section -- |
| 29 |
|
| 30 |
include system.in.init |
| 31 |
|
| 32 |
# -- Atom definition section -- |
| 33 |
|
| 34 |
read_data system.data |
| 35 |
|
| 36 |
# -- Settings Section -- |
| 37 |
|
| 38 |
include system.in.settings |
| 39 |
|
| 40 |
# -- Run section -- |
| 41 |
|
| 42 |
dump 1 all custom 250 traj_min.lammpstrj id mol type x y z ix iy iz |
| 43 |
|
| 44 |
# minimize |
| 45 |
|
| 46 |
thermo_style custom step temp pe etotal vol epair ebond eangle |
| 47 |
thermo 100 # time interval for printing out "thermo" data |
| 48 |
thermo_modify norm yes |
| 49 |
|
| 50 |
# distribute particles evenly on available processors: |
| 51 |
balance 1.05 shift xyz 20 1.05 |
| 52 |
|
| 53 |
min_style quickmin |
| 54 |
min_modify dmax 0.1 |
| 55 |
minimize 1.0e-5 1.0e-7 5000 20000 |
| 56 |
|
| 57 |
# If minimization crashes, then instead try Langevin dynamics |
| 58 |
# with a small timestep and a fast damping parameter. For example: |
| 59 |
# |
| 60 |
# timestep 0.05 |
| 61 |
# fix fxlan all langevin 300.0 300.0 100.0 48279 |
| 62 |
# fix fxnve all nve |
| 63 |
# |
| 64 |
# run 10000 |
| 65 |
|
| 66 |
write_data system_after_min.data |