| 1 |
# Use these commands to generate the LAMMPS input script and data file |
| 2 |
# (and other auxilliary files): |
| 3 |
|
| 4 |
# First, generate the coordinates (the "system.xyz" file). |
| 5 |
# (This can be a very slow process.) |
| 6 |
|
| 7 |
# check if packmol exists before running |
| 8 |
if ! hash packmol 2>/dev/null; then |
| 9 |
echo "packmol not found. This example cannot be run." |
| 10 |
exit 1 |
| 11 |
fi |
| 12 |
|
| 13 |
|
| 14 |
cd packmol_files |
| 15 |
|
| 16 |
# You must run each packmol commend one after the other. |
| 17 |
# |
| 18 |
# NOTE: If PACKMOL gets stuck in an endless loop, then edit the corresponding |
| 19 |
# "inp" file (edit the "tolerance" and "distscale"). This should not happen, |
| 20 |
# but keep in mind that PACKMOL can be very slow. (Step3 takes several days.) |
| 21 |
# |
| 22 |
# NOTE: You can also usually interrupt packmol after 1 hour. The solution |
| 23 |
# at that point (an .xyz file) should be good enough for use. |
| 24 |
# (Of course, you should check to see that the file exists and the |
| 25 |
# structure looks reasonable visually before interrupting packmol. Small |
| 26 |
# holes are okay. The simulation protocol we use should close them.) |
| 27 |
|
| 28 |
packmol < step1_proteins.inp # This step determines the protein's location |
| 29 |
# It takes ~40 minutes (on a 2015 intel i7) |
| 30 |
packmol < step2_innerlayer.inp # This step builds the inner monolayer |
| 31 |
# It takes ~10 hours |
| 32 |
packmol < step3_outerlayer.inp # This step builds the outer monolayer |
| 33 |
# It takes ~1-3 days |
| 34 |
cd .. |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
# Create LAMMPS input files this way: |
| 40 |
cd moltemplate_files |
| 41 |
|
| 42 |
# run moltemplate |
| 43 |
|
| 44 |
# (Note: we use the final .xyz file we created earlier.) |
| 45 |
moltemplate.sh -xyz ../packmol_files/step3_outerlayer.xyz system.lt |
| 46 |
|
| 47 |
# This will generate various files with names ending in *.in* and *.data. |
| 48 |
# These files are the input files directly read by LAMMPS. Move them to |
| 49 |
# the parent directory (or wherever you plan to run the simulation). |
| 50 |
|
| 51 |
mv -f system.in* system.data ../ |
| 52 |
|
| 53 |
# The "table_int.dat" file contains tabular data for the lipid INT-INT atom |
| 54 |
# 1/r^2 interaction. We need it too. (This slows down the simulation by x2, |
| 55 |
# so I might look for a way to get rid of it later.) |
| 56 |
cp -f table_int.dat ../ |
| 57 |
|
| 58 |
# Optional: |
| 59 |
# The "./output_ttree/" directory is full of temporary files generated by |
| 60 |
# moltemplate. They can be useful for debugging, but are usually thrown away. |
| 61 |
rm -rf output_ttree/ |
| 62 |
|
| 63 |
cd ../ |