| 1 |
# This file contains a definition for the "CH2" molecular subunit. |
| 2 |
|
| 3 |
import "oplsaa2024.lt" |
| 4 |
|
| 5 |
# The "oplsaa2024.lt" file defines these atom types: |
| 6 |
# @atom:54 "C - CT | n-CH3 C: alkane" |
| 7 |
# @atom:57 "C - CT | CH2 C: alkanes" |
| 8 |
# @atom:60 "H - HC | H: alkanes" |
| 9 |
# The "oplsaa2024.lt" file is at: |
| 10 |
# https://github.com/jewettaij/moltemplate/tree/master/moltemplate/force_fields/ |
| 11 |
# (If you want to customize this file, download it and copy it to this folder.) |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
CH2 inherits OPLSAA { |
| 16 |
|
| 17 |
# atom-id mol-id atom-type charge x y z |
| 18 |
|
| 19 |
write("Data Atoms") { |
| 20 |
$atom:c $mol:... @atom:57 0.0 0.000000 0.000000 0.000000 |
| 21 |
$atom:h1 $mol:... @atom:60 0.0 0.000000 0.631044 0.892431 |
| 22 |
$atom:h2 $mol:... @atom:60 0.0 0.000000 0.631044 -0.892431 |
| 23 |
} |
| 24 |
|
| 25 |
write('Data Bond List') { |
| 26 |
$bond:ch1 $atom:c $atom:h1 |
| 27 |
$bond:ch2 $atom:c $atom:h2 |
| 28 |
} |
| 29 |
|
| 30 |
} # CH2 |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
# Optional: Shift all the coordinates in the +Y direction by 0.4431163. |
| 36 |
# This way, the carbon atom is no longer located at 0,0,0, but the |
| 37 |
# axis of an alkane chain containing this monomer is at 0,0,0. |
| 38 |
# (This makes it more convenient to construct a polymer later. |
| 39 |
# If this is confusing, then simply add 0.4431163 to the Y |
| 40 |
# coordinates in the "Data Atoms" section above.) |
| 41 |
|
| 42 |
CH2.move(0,0.4431163,0) |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
# ---- NOTES: ---- |
| 48 |
# |
| 49 |
# In this example, atomic charges are generated by atom type (according to the |
| 50 |
# rules in oplsaa2024.lt), and can be omitted. Just leave them as "0.00" for now. |
| 51 |
# |
| 52 |
# The "..." in "$mol:..." tells moltemplate that this molecule may be part |
| 53 |
# of a larger molecule, and (if so) to use the larger parent object's |
| 54 |
# molecule id number as it's own. |
| 55 |
# |
| 56 |
######### (scratchwork calculations for the atomic coordinates) ######### |
| 57 |
# |
| 58 |
# Lcc = 1.5350 # length of the C-C bond (Sp3) |
| 59 |
# Lch = 1.0930 # length of the C-H bond |
| 60 |
# theta=2*atan(sqrt(2)) # ~= 109.5 degrees = tetrahedronal angle (C-C-C angle) |
| 61 |
# DeltaXc = Lcc*sin(theta/2) # = 1.2533222517240594 |
| 62 |
# DeltaYc = Lcc*cos(theta/2) # = 0.8862326632060754 |
| 63 |
# # 0.5*DeltaYc = 0.4431163 |
| 64 |
# DeltaZh = Lch*sin(theta/2) # = 0.892431 |
| 65 |
# DeltaYh = Lch*cos(theta/2) # = 0.631044 |