import "trappe1998.lt"

# The "trappe1998.lt" file is usually located in $MOLTEMPLATE_PATH (and is 
# distributed with moltemplate. See the "Installation" section in the manual.)
# It contains definitions of the atoms "CH2", "CH3", and "CH4", as well
# as "saturated" bonds, and the parameters for (bonded/nonbonded)
# interactions between these atoms (all enclosed within the "TraPPE" namespace).


Cyclododecane {

  write('Data Atoms') {
    $atom:C1 $mol:. @atom:TraPPE/CH2  0.0  0.00000 2.94118 0.0
    $atom:C2 $mol:. @atom:TraPPE/CH2  0.0  0.00000 2.54714 1.47059
    $atom:C3 $mol:. @atom:TraPPE/CH2  0.0  0.00000 1.47059 2.54714
    $atom:C4 $mol:. @atom:TraPPE/CH2  0.0  0.00000 0.0 2.94118
    $atom:C5 $mol:. @atom:TraPPE/CH2  0.0  0.00000 -1.47059 2.54714
    $atom:C6 $mol:. @atom:TraPPE/CH2  0.0  0.00000 -2.54714 1.47059
    $atom:C7 $mol:. @atom:TraPPE/CH2  0.0  0.00000 -2.94118 0.0
    $atom:C8 $mol:. @atom:TraPPE/CH2  0.0  0.00000 -2.54714 -1.47059
    $atom:C9 $mol:. @atom:TraPPE/CH2  0.0  0.00000 -1.47059 -2.54714
    $atom:C10 $mol:. @atom:TraPPE/CH2  0.0  0.00000 -0.0 -2.94118
    $atom:C11 $mol:. @atom:TraPPE/CH2  0.0  0.00000 1.47059 -2.54714
    $atom:C12 $mol:. @atom:TraPPE/CH2  0.0  0.00000 2.54714 -1.47059
  }

  #  The "." in "$mol:." refers to the current object's molecule ID,
  #  and "@atom:TraPPE/CH2" refers to the "CH2" atom-type defined in TraPPE

  write('Data Bonds') {
    $bond:bond1 @bond:TraPPE/saturated $atom:C1 $atom:C2
    $bond:bond2 @bond:TraPPE/saturated $atom:C2 $atom:C3
    $bond:bond3 @bond:TraPPE/saturated $atom:C3 $atom:C4
    $bond:bond4 @bond:TraPPE/saturated $atom:C4 $atom:C5
    $bond:bond5 @bond:TraPPE/saturated $atom:C5 $atom:C6
    $bond:bond6 @bond:TraPPE/saturated $atom:C6 $atom:C7
    $bond:bond7 @bond:TraPPE/saturated $atom:C7 $atom:C8
    $bond:bond8 @bond:TraPPE/saturated $atom:C8 $atom:C9
    $bond:bond9 @bond:TraPPE/saturated $atom:C9 $atom:C10
    $bond:bond10 @bond:TraPPE/saturated $atom:C10 $atom:C11
    $bond:bond11 @bond:TraPPE/saturated $atom:C11 $atom:C12
    $bond:bond12 @bond:TraPPE/saturated $atom:C12 $atom:C1
  }

} # Cyclododecane


# coordinates in the "Data Atoms" section generated by this python code:
# from math import *
# bond_length=1.54
# N=12
# R=(N*bond_length)/(2*pi)
# for i in range(0,N):
#     print('$atom:C'+str(i+1)+' $mol:... @atom:TraPPE/CH2  0.0  0.00000 '+
#           str(round(R*cos(i*2*pi/N),5))+' '+str(round(R*sin(i*2*pi/N),5)))
