| 1 |
# This file contains a definition for the "CH2" molecular subunit. |
| 2 |
|
| 3 |
# First, load the OPLS force field parameters we will need. |
| 4 |
# This file is located in the "force_fields" subdirectory |
| 5 |
# distributed with moltemplate. |
| 6 |
|
| 7 |
import "loplsaa2024.lt" # <-- defines the standard "OPLSAA" force field as well as |
| 8 |
# custom parameters for long alkane chains taken from |
| 9 |
# Sui et al. J.Chem.Theory.Comp (2012), 8, 1459 |
| 10 |
# To use the ordinary OPLSAA force field parameters, |
| 11 |
# (instead of the Sui et al. parameters), change the |
| 12 |
# atom types below from "@atom:57L","@atom:60LCH2" to |
| 13 |
# "@atom:57" and "@atom:60" (defined in "oplsaa2024.lt") |
| 14 |
|
| 15 |
# The "loplsaa2024.lt" and "oplsaa2024.lt" files are located at: |
| 16 |
# https://github.com/jewettaij/moltemplate/tree/master/moltemplate/force_fields/ |
| 17 |
# If you want to customize these files, download them and copy them to this folder. |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
CH2 inherits OPLSAA { |
| 23 |
|
| 24 |
# atom-id mol-id atom-type charge x y z |
| 25 |
|
| 26 |
write("Data Atoms") { |
| 27 |
$atom:c $mol:... @atom:57L 0.0 0.000000 0.000000 0.000000 |
| 28 |
$atom:H1 $mol:... @atom:60LCH2 0.0 0.000000 0.631044 0.892431 |
| 29 |
$atom:H2 $mol:... @atom:60LCH2 0.0 0.000000 0.631044 -0.892431 |
| 30 |
} |
| 31 |
|
| 32 |
write('Data Bond List') { |
| 33 |
$bond:ch1 $atom:c $atom:H1 |
| 34 |
$bond:ch2 $atom:c $atom:H2 |
| 35 |
} |
| 36 |
|
| 37 |
# Atom type numbers (@atom:57L,@atom:60LCH3) are defined in "loplsaa2024.lt", |
| 38 |
# @atom:54L "C - CT | n-CH3 C: alkane (LOPLS, 2012)" |
| 39 |
# @atom:57L "C - CT | CH2 C: alkanes (LOPLS, 2012)" |
| 40 |
# @atom:60LCH3 "H - HC | CH3 H: alkanes (LOPLS,2012)" |
| 41 |
# @atom:60LCH2 "H - HC | CH2 H: alkanes (LOPLS,2012)" |
| 42 |
# In this example, atomic charges are generated by atom type (according to the |
| 43 |
# rules in loplsaa2024.lt), and can be omitted. Just leave them as "0.0" for now. |
| 44 |
# The "..." in "$mol:..." tells moltemplate that this molecule may be part |
| 45 |
# of a larger molecule, and (if so) to use the larger parent object's |
| 46 |
# molecule id number as it's own. |
| 47 |
|
| 48 |
} # CH2 |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
# Optional: Shift all the coordinates in the +Y direction by 0.4431163. |
| 65 |
# This way, the carbon atom is no longer located at 0,0,0, but the |
| 66 |
# axis of an alkane chain containing this monomer is at 0,0,0. |
| 67 |
# (This makes it more convenient to construct a polymer later. |
| 68 |
# If this is confusing, then simply add 0.4431163 to the Y |
| 69 |
# coordinates in the "Data Atoms" section above.) |
| 70 |
|
| 71 |
CH2.move(0,0.4431163,0) |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
######### (scratchwork calculations for the atomic coordinates) ######### |
| 77 |
# Lcc = 1.5350 # length of the C-C bond (Sp3) |
| 78 |
# Lch = 1.0930 # length of the C-H bond |
| 79 |
# theta=2*atan(sqrt(2)) # ~= 109.5 degrees = tetrahedronal angle (C-C-C angle) |
| 80 |
# DeltaXc = Lcc*sin(theta/2) # = 1.2533222517240594 |
| 81 |
# DeltaYc = Lcc*cos(theta/2) # = 0.8862326632060754 |
| 82 |
# # 0.5*DeltaYc = 0.4431163 |
| 83 |
# DeltaZh = Lch*sin(theta/2) # = 0.892431 |
| 84 |
# DeltaYh = Lch*cos(theta/2) # = 0.631044 |