| 1 |
import "benzene.lt" # <- defines the "Benzene" molecule type. |
| 2 |
import "benzoic_acid.lt" # <- defines the "BenzoicAcid" molecule type. |
| 3 |
|
| 4 |
|
| 5 |
# Periodic boundary conditions: |
| 6 |
write_once("Data Boundary") { |
| 7 |
0.0 48.00 xlo xhi |
| 8 |
0.0 48.00 ylo yhi |
| 9 |
0.0 48.00 zlo zhi |
| 10 |
} |
| 11 |
|
| 12 |
|
| 13 |
# Create 108 "Benzene" molecules and arrange them in a 6x6x3 cubic lattice with |
| 14 |
# 8.0 Angstrom spacing in the x,y directions and 16 Anstrom spacing along Z. |
| 15 |
|
| 16 |
benzenes = new Benzene[6].move(8.0, 0, 0) |
| 17 |
[6].move(0, 8.0, 0) |
| 18 |
[3].move(0, 0, 16.0) |
| 19 |
|
| 20 |
# Create 108 "BenzoicAcid" molecules and arrange them in a 6x6x3 cubic lattice with |
| 21 |
# 8.0 Angstrom spacing in the x,y directions and 16 Anstrom spacing along Z. |
| 22 |
|
| 23 |
benzoic_acids = new BenzoicAcid[6].move(8.0, 0, 0) |
| 24 |
[6].move(0, 8.0, 0) |
| 25 |
[3].move(0, 0, 16.0) |
| 26 |
|
| 27 |
# Now shift the positions of all of the BenzoicAcid molecules, |
| 28 |
# to reduce the chance that they overlap with the Benzene molecules. |
| 29 |
|
| 30 |
benzoic_acids[*][*][*].move(4.0, 4.0, 6.0) |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
# Note1: You can use the "new random" command to create mixtures of different |
| 35 |
# molecule types containing an arbitrary number of molecules arranged on |
| 36 |
# a periodic lattice. (This works if all molecules have similar size.) |
| 37 |
# See manual (ch8.9.1): https://moltemplate.org/doc/moltemplate_manual.pdf |
| 38 |
# Note2: More generally you can use PACKMOL to create mixtures of molecules. |
| 39 |
# It allows us to omit the coordinates and .move() commands. And you can |
| 40 |
# specify the number of molecules you want more precisely. See example: |
| 41 |
# https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_OPLSAA/ethylene+benzene_PACKMOL/ |