| 1 |
# This simulation compresses the vesicle between two concentric spheres. |
| 2 |
# This allows the density of lipids to equilibrate without allowing the |
| 3 |
# lipids to deviate much from a spherical shape. |
| 4 |
# (Later, in run.in, we allow the lipids to move anywhere they want.) |
| 5 |
# |
| 6 |
# (Why? The software tool (PACKMOL) that we used to create the initial |
| 7 |
# geometry for this example often leaves gaps in the packing of spherical |
| 8 |
# surfaces, or fails to pack the lipids with uniform density in |
| 9 |
# certain directions. If you start a simulation with the original PACKMOL |
| 10 |
# packing, bulges and holes will quickly develop on at least one side |
| 11 |
# of the lipid bilayer. This protocol greatly reduces this problem.) |
| 12 |
# |
| 13 |
# After you have run this simulation, you can run an ordinary simulation |
| 14 |
# with no constraints. |
| 15 |
# |
| 16 |
# -------- PREREQUISITES: --------- |
| 17 |
# 1) This example requires the "EXTRA-MOLECULE" package. |
| 18 |
# If you encounter the error *"Invalid dihedral_style"*, then see this page: |
| 19 |
# https://lammps.sandia.gov/doc/Build_package.html |
| 20 |
# for instructions to compile LAMMPS to support this package. |
| 21 |
# 2) It also may require additional features and bug fixes for LAMMPS. |
| 22 |
# So, after typing "make yes-user-misc" in to the shell, ... |
| 23 |
# be sure to download and copy the "additional_lammps_code" from |
| 24 |
# http://moltemplate.org (upper-left corner menu) |
| 25 |
# 3) Unpack it |
| 26 |
# 4) copy the .cpp and .h files to the src folding of your lammps installation. |
| 27 |
# 5) Compile LAMMPS. |
| 28 |
# 6) Build the system using PACKMOL and MOLTEMPLATE |
| 29 |
# (Follow the instructions in README_setup.sh, or run that file as a script.) |
| 30 |
# 7) Minimize the system using: |
| 31 |
# lmp_mpi -i run.in.npt |
| 32 |
# (assuming "lmp_mpi" is the name of the lammps binary you created in step 5) |
| 33 |
# |
| 34 |
# If LAMMPS complains about an "Invalid pair_style", or "Invalid dihedral_style" |
| 35 |
# then you made a mistake in the instructions above. |
| 36 |
# |
| 37 |
# ------------------------------ Initialization Section --------------------- |
| 38 |
|
| 39 |
include system.in.init |
| 40 |
|
| 41 |
# ------------------------------ Atom Definition Section -------------------- |
| 42 |
|
| 43 |
# Commenting out: |
| 44 |
# read_data system.data |
| 45 |
# |
| 46 |
# Instead read the data file created by "run.in.min". |
| 47 |
|
| 48 |
read_data system_after_min.data |
| 49 |
|
| 50 |
# ------------------------------ Settings Section --------------------------- |
| 51 |
|
| 52 |
include system.in.settings |
| 53 |
|
| 54 |
# ------------------------------ Constraints ------------------------------- |
| 55 |
|
| 56 |
# How to compress the system using "fix wall/region" |
| 57 |
# |
| 58 |
# Define "rSphere", a spherical region |
| 59 |
# |
| 60 |
# sphere_center radius |
| 61 |
# x0 y0 z0 rc0 |
| 62 |
# | | | | |
| 63 |
# \|/ \|/ \|/ \|/ |
| 64 |
# V V V V |
| 65 |
|
| 66 |
region rSphereOut sphere 0.0 0.0 0.0 430.0 side in |
| 67 |
region rSphereIn sphere 0.0 0.0 0.0 250.0 side out |
| 68 |
|
| 69 |
# Now apply an inward force applied to every particle which lies outside a |
| 70 |
# spherical region (of radius rc0-rc). (Particles with r < rc0-rc feel |
| 71 |
# no force.) The energy of each particle (due to the confinement force) is: |
| 72 |
# |
| 73 |
# Uexternal(r) = k*(rsurf-rc)^2 |
| 74 |
# where "rsurf" = the distance from the particle to the surface = rc0 - r |
| 75 |
# = k*((rc0-rc) - r)^2 |
| 76 |
# |
| 77 |
# k ignore rc |
| 78 |
# | | | |
| 79 |
# \|/ \|/ \|/ |
| 80 |
# V V V |
| 81 |
|
| 82 |
fix fxWallOut all wall/region rSphereOut harmonic 0.005 0.0 65.0 |
| 83 |
fix fxWallIn all wall/region rSphereIn harmonic 0.0002 0.0 46.0 |
| 84 |
|
| 85 |
# This will sandwhich the lipids between two concentric spheres |
| 86 |
# The external force applied by theses spheres is the sum of |
| 87 |
# two potentials of the form: |
| 88 |
# |
| 89 |
# Uexternal(r) = k*((rc0-rc) - r)^2 (if (rc0-rc) < r < rc0, 0 otherwise) |
| 90 |
# |
| 91 |
# Note that rc0-rc = the radius above which inward forces apply |
| 92 |
# rc0-rc = 365.0 (for fxWallOut) |
| 93 |
# Note that rc0-rc = the radius below which outward forces apply |
| 94 |
# rc0-rc = 296.0 (for fxWallIn) |
| 95 |
# |
| 96 |
# |
| 97 |
# For a (confusing) explanation of these commands, see: |
| 98 |
# http://lammps.sandia.gov/doc/fix_wall_region.html |
| 99 |
# http://lammps.sandia.gov/doc/region.html |
| 100 |
|
| 101 |
# ------------------------------ Run Section -------------------------------- |
| 102 |
|
| 103 |
timestep 1.0 # (The particle masses must be adjusted accordingly.) |
| 104 |
dump 1 all custom 20000 traj_make_uniform.lammpstrj id mol type x y z ix iy iz |
| 105 |
|
| 106 |
|
| 107 |
thermo_style custom step temp pe etotal vol epair ebond eangle |
| 108 |
thermo 100 # time interval for printing out "thermo" data |
| 109 |
thermo_modify norm yes flush yes |
| 110 |
|
| 111 |
|
| 112 |
# distribute particles evenly on available processors: |
| 113 |
fix fxbal all balance 100000 1.05 shift xyz 20 1.05 |
| 114 |
|
| 115 |
|
| 116 |
# To use Langevin dynamics in LAMMPS you need both "fix langevin" and "fix nve". |
| 117 |
# (See http://lammps.sandia.gov/doc/fix_langevin.html for details.) |
| 118 |
# (Note: We are using "units lj", which means temperature is specified |
| 119 |
# in units of energy. kB*Temp = 0.001987207*300 kcal/mole = 0.5961621) |
| 120 |
fix fxlan all langevin 0.5961621 0.5961621 40 482790 |
| 121 |
fix fxnve all nve |
| 122 |
|
| 123 |
# Note: The energy scale "epsilon" = 2.75kJ/mole = 330.7485200981 Kelvin*kB. |
| 124 |
# So a temperature of 300.0 Kelvin corresponds to 0.907033536873*epsilon. |
| 125 |
# Note: A langevin damping parameter "120" would correspond to |
| 126 |
# the 0.12ps damping time used in Watson et. al JCP 2011. |
| 127 |
|
| 128 |
run 5000 |
| 129 |
unfix fxlan |
| 130 |
unfix fxWallIn |
| 131 |
unfix fxWallOut |
| 132 |
|
| 133 |
fix fxWallOut all wall/region rSphereOut harmonic 0.005 0.0 65.0 |
| 134 |
fix fxWallIn all wall/region rSphereIn harmonic 0.005 0.0 46.0 |
| 135 |
fix fxlan all langevin 0.5961621 0.5961621 500 482791 |
| 136 |
run 5000 |
| 137 |
unfix fxWallIn |
| 138 |
unfix fxWallOut |
| 139 |
|
| 140 |
fix fxWallOut all wall/region rSphereOut harmonic 0.005 0.0 65.0 |
| 141 |
fix fxWallIn all wall/region rSphereIn harmonic 0.005 0.0 46.0 |
| 142 |
fix fxlan all langevin 0.5961621 0.5961621 500 482791 |
| 143 |
run 5000 |
| 144 |
unfix fxWallIn |
| 145 |
unfix fxWallOut |
| 146 |
|
| 147 |
|
| 148 |
fix fxWallOut all wall/region rSphereOut harmonic 0.005 0.0 65.0 |
| 149 |
fix fxWallIn all wall/region rSphereIn harmonic 0.005 0.0 46.0 |
| 150 |
fix fxlan all langevin 0.5961621 0.5961621 10000 482792 |
| 151 |
run 25000 |
| 152 |
unfix fxWallIn |
| 153 |
unfix fxWallOut |
| 154 |
|
| 155 |
|
| 156 |
fix fxWallOut all wall/region rSphereOut harmonic 0.005 0.0 60.0 |
| 157 |
fix fxWallIn all wall/region rSphereIn harmonic 0.001 0.0 51.0 |
| 158 |
fix fxlan all langevin 0.5961621 0.5961621 400 482793 |
| 159 |
run 10000 |
| 160 |
unfix fxlan |
| 161 |
unfix fxWallIn |
| 162 |
unfix fxWallOut |
| 163 |
|
| 164 |
fix fxWallOut all wall/region rSphereOut harmonic 0.005 0.0 55.0 |
| 165 |
fix fxWallIn all wall/region rSphereIn harmonic 0.001 0.0 56.0 |
| 166 |
fix fxlan all langevin 0.5961621 0.5961621 400 482794 |
| 167 |
run 10000 |
| 168 |
unfix fxlan |
| 169 |
unfix fxWallIn |
| 170 |
unfix fxWallOut |
| 171 |
|
| 172 |
fix fxWallOut all wall/region rSphereOut harmonic 0.005 0.0 55.0 |
| 173 |
fix fxWallIn all wall/region rSphereIn harmonic 0.001 0.0 56.0 |
| 174 |
fix fxlan all langevin 0.5961621 0.5961621 10000 482794 |
| 175 |
run 20000 |
| 176 |
unfix fxlan |
| 177 |
unfix fxWallIn |
| 178 |
unfix fxWallOut |
| 179 |
|
| 180 |
fix fxWallOut all wall/region rSphereOut harmonic 0.005 0.0 50.0 |
| 181 |
fix fxWallIn all wall/region rSphereIn harmonic 0.001 0.0 61.0 |
| 182 |
fix fxlan all langevin 0.5961621 0.5961621 400 482795 |
| 183 |
run 10000 |
| 184 |
unfix fxlan |
| 185 |
unfix fxWallIn |
| 186 |
unfix fxWallOut |
| 187 |
|
| 188 |
fix fxWallOut all wall/region rSphereOut harmonic 0.002 0.0 45.0 |
| 189 |
fix fxWallIn all wall/region rSphereIn harmonic 0.0005 0.0 61.0 |
| 190 |
fix fxlan all langevin 0.5961621 0.5961621 400 482796 |
| 191 |
run 10000 |
| 192 |
unfix fxlan |
| 193 |
unfix fxWallIn |
| 194 |
unfix fxWallOut |
| 195 |
|
| 196 |
fix fxWallOut all wall/region rSphereOut harmonic 0.001 0.0 40.0 |
| 197 |
fix fxWallIn all wall/region rSphereIn harmonic 0.0005 0.0 61.0 |
| 198 |
fix fxlan all langevin 0.5961621 0.5961621 400 482797 |
| 199 |
run 10000 |
| 200 |
unfix fxlan |
| 201 |
unfix fxWallIn |
| 202 |
unfix fxWallOut |
| 203 |
|
| 204 |
fix fxWallOut all wall/region rSphereOut harmonic 0.001 0.0 40.0 |
| 205 |
fix fxWallIn all wall/region rSphereIn harmonic 0.0005 0.0 61.0 |
| 206 |
fix fxlan all langevin 0.5961621 0.5961621 10000 482797 |
| 207 |
run 30000 |
| 208 |
unfix fxlan |
| 209 |
unfix fxWallIn |
| 210 |
unfix fxWallOut |
| 211 |
|
| 212 |
fix fxWallOut all wall/region rSphereOut harmonic 0.0004 0.0 35.0 |
| 213 |
fix fxWallIn all wall/region rSphereIn harmonic 0.0002 0.0 61.0 |
| 214 |
fix fxlan all langevin 0.5961621 0.5961621 400 482798 |
| 215 |
run 20000 |
| 216 |
unfix fxlan |
| 217 |
unfix fxWallIn |
| 218 |
unfix fxWallOut |
| 219 |
|
| 220 |
fix fxWallOut all wall/region rSphereOut harmonic 0.0002 0.0 35.0 |
| 221 |
fix fxWallIn all wall/region rSphereIn harmonic 0.00004 0.0 61.0 |
| 222 |
fix fxlan all langevin 0.5961621 0.5961621 400 482799 |
| 223 |
run 20000 |
| 224 |
unfix fxlan |
| 225 |
unfix fxWallIn |
| 226 |
unfix fxWallOut |
| 227 |
|
| 228 |
fix fxlan all langevin 0.5961621 0.5961621 50 482800 |
| 229 |
run 5000 |
| 230 |
unfix fxlan |
| 231 |
|
| 232 |
fix fxlan all langevin 0.5961621 0.5961621 400 482800 |
| 233 |
run 15000 |
| 234 |
unfix fxlan |
| 235 |
|
| 236 |
fix fxlan all langevin 0.5961621 0.5961621 10000 482800 |
| 237 |
run 40000 |
| 238 |
unfix fxlan |
| 239 |
|
| 240 |
write_data system_uniform.data |