| 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 |
# (See README_setup.sh for details.) |
| 6 |
# |
| 7 |
# 2) You must then run the minimization simulation beforehand using: |
| 8 |
# lmp_mpi -i run.in.min (assuming "lmp_mpi" is your lammps binary's name) |
| 9 |
|
| 10 |
# ------------------------------- Initialization Section -------------------- |
| 11 |
|
| 12 |
include system.in.init |
| 13 |
|
| 14 |
# ------------------------------- Atom Definition Section ------------------- |
| 15 |
|
| 16 |
#read_data system.data <-commenting out. use minimized conformation instead |
| 17 |
|
| 18 |
read_data system_after_min.data |
| 19 |
|
| 20 |
# ------------------------------- Settings Section -------------------------- |
| 21 |
|
| 22 |
include system.in.settings #(define force fields and constraints) |
| 23 |
|
| 24 |
# ------------------------------- Run Section ------------------------------- |
| 25 |
|
| 26 |
# -- files containing trajectory data and other information -- |
| 27 |
|
| 28 |
thermo_style custom step temp pe ke etotal press vol epair ebond eangle edihed |
| 29 |
thermo_modify norm yes |
| 30 |
thermo 100 |
| 31 |
dump 1 all custom 500 traj_npt.lammpstrj id mol type x y z ix iy iz |
| 32 |
|
| 33 |
|
| 34 |
# -- simulation protocol -- |
| 35 |
|
| 36 |
velocity all create 298.0 12345 # choose the starting velocities randomly |
| 37 |
|
| 38 |
|
| 39 |
timestep 1.0 |
| 40 |
|
| 41 |
|
| 42 |
group gRigid union gH2O gH2O |
| 43 |
group gFlexible subtract all gRigid |
| 44 |
|
| 45 |
# Give each atom a random initial velocity consistent with a system at 298K. |
| 46 |
velocity all create 298.0 12345 |
| 47 |
|
| 48 |
fix fxRigid gH2O rigid/nph/small molecule iso 1 1 1000 |
| 49 |
fix fxFlexible gFlexible nve |
| 50 |
fix fxLanvegin all langevin 298 298 10000.0 48279 |
| 51 |
|
| 52 |
run 100000 |
| 53 |
|
| 54 |
write_data system_after_npt.data |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
# NOTE: |
| 61 |
# The following alternate protocol seems to agree with the protocol used above: |
| 62 |
# (but this observation was based on an extremely short simulation) |
| 63 |
# |
| 64 |
# fix fxRigid gH2O rigid/npt/small molecule temp 298 298 100 iso 1 1 1000 |
| 65 |
# fix fxFlexible gFlexible nvt temp 298 298 100.0 |
| 66 |
# |
| 67 |
# <temp>~=297, <ke>~=0.45, <press>~=0, <volume>~=21900 (based on 10000 steps) |
| 68 |
# |
| 69 |
# |
| 70 |
# |
| 71 |
# |
| 72 |
# AVOID THESE PROTOCOLS FOR SIMULATIONS CONTAINING RIGID & FLEXIBLE MOLECULES: |
| 73 |
# 1) |
| 74 |
# fix fxRigid gH2O rigid/nvt/small molecule temp 298 298 100 |
| 75 |
# fix fxFlexible gFlexible npt temp 298 298 100.0 iso 1 1 1000 |
| 76 |
# (System behaves as if being compressed) |
| 77 |
# <temp>~=295, <ke>~=0.46, <press>~=10000, <volume>~=16500 (based on 10000steps)# 2) |
| 78 |
# fix fxRigid gH2O rigid/nve/small molecule |
| 79 |
# fix fxFlexible gFlexible nph iso 1 1 1000 |
| 80 |
# fix fxLanvegin all langevin 298 298 5000.0 48279 |
| 81 |
# (System behaves as if compressed. Temperature is elevated) |
| 82 |
# <temp>~=315, <ke>~=0.48, <press>~=11000, <volume>~=17000 (based on 10000steps) |
| 83 |
# 3) |
| 84 |
# fix fxRigid gH2O rigid/npt/small molecule temp 298 298 100 iso 1 1 1000 |
| 85 |
# fix fxFlexible gFlexible nve |
| 86 |
# (System behaves as it would at a lower temperature) |
| 87 |
# <temp>~=241, <ke>~=0.36, <press>~=0, <volume>~=20800 (based on 10000steps) |
| 88 |
# 4) |
| 89 |
# fix fxRigid gH2O rigid/nve/small molecule langevin 298 298 5000.0 48279 |
| 90 |
# fix fxFlexible gFlexible nph iso 1 1 1000 |
| 91 |
# fix fxLanvegin gFlexible langevin 298 298 5000.0 48279 |
| 92 |
# (System behaves as if compressed. Temperature is elevated) |
| 93 |
# <temp>~=315, <ke>~=0.48, <press>~=10000, <volume>~=17000 (based on 10000steps) |
| 94 |
# 5) |
| 95 |
# fix fxRigid gH2O rigid/nph/small molecule iso 1 1 1000 |
| 96 |
# fix fxFlexible gFlexible nvt temp 298 298 100.0 |
| 97 |
# (system behaves as it would at a higher temperature) |
| 98 |
# <temp>~=355, <ke>~=55, <press>~=0, <volume>~=30000 (based on 10000 steps) |
| 99 |
# |
| 100 |
# |
| 101 |
# |
| 102 |
# |
| 103 |
# EXCERPT from "https://lammps.sandia.gov/doc/fix_rigid.html" |
| 104 |
# "If you with to perform NPT or NPH dynamics (barostatting), you cannot |
| 105 |
# use both fix npt and the NPT or NPH rigid styles. This is because there |
| 106 |
# can be one fix which monitors the global pressure and changes the |
| 107 |
# simulation box dimensions. So you have 3 choices: |
| 108 |
# |
| 109 |
# Use one of the 4 NPT or NPH styles for the rigid bodies. Use the dilate all |
| 110 |
# option so that it will dilate the positions of the non-rigid particles as well |
| 111 |
# |
| 112 |
# Use fix nvt (or any other thermostat) for the non-rigid particles. |
| 113 |
# Use fix npt for the group of non-rigid particles. Use the dilate all option |
| 114 |
# so that it will dilate the center-of-mass positions of the rigid bodies as |
| 115 |
# well. Use one of the 4 NVE or 2 NVT rigid styles for the rigid bodies. |
| 116 |
# |
| 117 |
# Use fix press/berendsen to compute the pressure and change the box dimensions. |
| 118 |
# Use one of the 4 NVE or 2 NVT rigid styles for the rigid bodies. Use fix nvt |
| 119 |
# (or any other thermostat) for the non-rigid particles. |
| 120 |
# |
| 121 |
# In all case, the rigid bodies and non-rigid particles both contribute to |
| 122 |
# the global pressure and the box is scaled the same by any of the |
| 123 |
# barostatting fixes." |