| 1 |
import "methane.lt" # <- defines the "Methane" molecule type (uses OPLSAA) |
| 2 |
import "spce_oplsaa2024.lt" # <- defines the "SPCE" (water) molecule type. |
| 3 |
|
| 4 |
# Note: The "spc_oplsaa2024.lt" file is located at: |
| 5 |
# https://github.com/jewettaij/moltemplate/tree/master/moltemplate/force_fields/ |
| 6 |
# (If you want to customize it, you can download it and copy it to this folder.) |
| 7 |
|
| 8 |
|
| 9 |
# Periodic boundary conditions: |
| 10 |
write_once("Data Boundary") { |
| 11 |
0.0 41.50 xlo xhi |
| 12 |
0.0 41.50 ylo yhi |
| 13 |
0.0 41.50 zlo zhi |
| 14 |
} |
| 15 |
|
| 16 |
# The next command generates a (rather dense) cubic lattice with |
| 17 |
# spacing 3.45 Angstroms. (The pressure must be equilibrated later.) |
| 18 |
|
| 19 |
waters = new SPCE [12].move(0.00, 0.00, 3.45) |
| 20 |
[12].move(0.00, 3.45, 0.00) |
| 21 |
[12].move(3.45, 0.00, 0.00) |
| 22 |
|
| 23 |
# Now add methane molecules: |
| 24 |
|
| 25 |
methanes = new Methane [4].move(0, 0, 10.35) |
| 26 |
[4].move(0, 10.35, 0) |
| 27 |
[4].move(10.35, 0, 0) |
| 28 |
|
| 29 |
# Move the methane molecules slightly to reduce overlap with the water |
| 30 |
methanes[*][*][*].move(1.725, 1.725, 1.725) |
| 31 |
|
| 32 |
|
| 33 |
# Note1: You can use the "new random" command to create mixtures of different |
| 34 |
# molecule types containing an arbitrary number of molecules arranged on |
| 35 |
# a periodic lattice. (This works if all molecules have similar size.) |
| 36 |
# See manual (ch8.9.1): https://moltemplate.org/doc/moltemplate_manual.pdf |
| 37 |
# Note2: More generally you can use PACKMOL to create mixtures of molecules. |
| 38 |
# It allows us to omit the coordinates and .move() commands. And you can |
| 39 |
# specify the number of molecules you want more precisely. See example: |
| 40 |
# https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_OPLSAA/ethylene+benzene_PACKMOL/ |