| 1 |
# PREREQUISITES: |
| 2 |
# |
| 3 |
# 1) You must use moltemplate.sh to create 4 files: |
| 4 |
# system.data system.in.init system.in.settings system.in.charges |
| 5 |
# (Follow the instructions in README_setup.sh, |
| 6 |
# or run the file as a script using ./README_setup.sh) |
| 7 |
# 2) You must minimize the system beforehand using "run.in.min". |
| 8 |
# This will create the file "system_after_min.data" which this file reads. |
| 9 |
|
| 10 |
# ------------------------------- Initialization Section -------------------- |
| 11 |
|
| 12 |
include "system.in.init" |
| 13 |
|
| 14 |
# ------------------------------- Atom Definition Section ------------------- |
| 15 |
|
| 16 |
read_data "system_after_min.data" |
| 17 |
|
| 18 |
# OPLSAA atom charges are stored in a separate file. |
| 19 |
# Load that file now: |
| 20 |
|
| 21 |
include "system.in.charges" |
| 22 |
|
| 23 |
# ------------------------------- Settings Section -------------------------- |
| 24 |
|
| 25 |
include "system.in.settings" |
| 26 |
|
| 27 |
# ------------------------------- Run Section ------------------------------- |
| 28 |
|
| 29 |
|
| 30 |
print "---------------------------------------------------------------------------" |
| 31 |
print "First, use Langevin dynamics to randomize the initial shape of the molecules" |
| 32 |
print "(This is not really necessary, but it seems to speed up equilibration.)" |
| 33 |
print "---------------------------------------------------------------------------" |
| 34 |
|
| 35 |
# Give each atom a random initial velocity consistent with a system at 300K. |
| 36 |
velocity all create 300.0 12345 |
| 37 |
|
| 38 |
# Run a short simulation using a Langevin thermostat (for improved stability). |
| 39 |
fix fxlan all langevin 300.0 300.0 120 123456 # temp: 300 K |
| 40 |
fix fxnph all nph iso 100.0 100.0 1000.0 # pressure: 100 atm |
| 41 |
run 2000 |
| 42 |
unfix fxlan |
| 43 |
unfix fxnph |
| 44 |
|
| 45 |
print "---------------------------------------------------------------------------" |
| 46 |
print "--- Now continue the simulation using a Nose-Hoover Thermostat/Barostat ---" |
| 47 |
print "---------------------------------------------------------------------------" |
| 48 |
dump 1 all custom 1000 traj_npt.lammpstrj id mol type x y z ix iy iz |
| 49 |
# temperature: 300 K, pressure: 100 atm |
| 50 |
fix fxnpt all npt temp 300.0 300.0 100.0 iso 100.0 100.0 1000.0 drag 1.0 |
| 51 |
thermo 100 |
| 52 |
#thermo_modify flush yes |
| 53 |
|
| 54 |
timestep 2.0 |
| 55 |
run 100000 |
| 56 |
|
| 57 |
write_data system_after_npt.data |