Beispiel #1
0
#Add atoms, bonds, and angles
len_bond = 2.0 #0.97*sigma #Equilibrium bond length
theta = (25.0/180.0)*math.pi
sep = 2.0 # Must be <= len_bond

#Loop over all molecules (here only a single molecule type)
imol = 1; iatm = 1; ibnd = 1; iang = 1 #Index of one past the last atom, bond, etc. added
for imol in range(1, num_mols+1):
    iatm_beg = iatm
    ibnd_beg = ibnd
    iang_beg = iang

    config.append_atom_unbonded( atm_t_bb, 0.0 )
    iatm += 1
    config.append_atom_bonded(1, 0.0, len_bond, 'efjc', iatm-1, sep=sep)
    iatm += 1
    for i in range(3,natm+1):
        config.append_atom_bonded(atm_t_bb, 0.0, len_bond, 'efjc',
                iatm-1, im2=iatm-2, theta=theta, sep=sep)
        iatm += 1
    
    for i in range(1, nbnd+1):
        j = iatm_beg + i - 1
        config.add_bond(bnd_t_bb, j, j+1)
        ibnd += 1
    
    for i in range(1, nang+1):
        j = iatm_beg + i - 1
        config.add_angle(ang_t_bb, j, j+1, j+2)
        iang += 1
Beispiel #2
0
#Add atoms, bonds, etc
#Loop over all molecules (here only a single molecule type)
imol = 1
iatm = 1
ibnd = 1  #Index of atom, bond, etc. of the next entity to be added
for imol in range(1, num_mols + 1):
    iatm_beg = iatm
    ibnd_beg = ibnd

    #Backbone
    #Put first atom at the origin
    config.add_atom(atm_t_bb, 0.0, np.zeros((3, )))
    iatm += 1
    #Put second atom along x-axis
    config.append_atom_bonded(atm_t_bb, 0.0, len_bond, 'alignx', iatm - 1)
    iatm += 1
    #Put the rest of the backbone atoms
    for i in range(3, na_bbone + 1):
        config.append_atom_bonded(atm_t_bb,
                                  0.0,
                                  len_bond,
                                  'alignx',
                                  iatm - 1,
                                  im2=iatm - 2,
                                  theta=theta_bb,
                                  sep=sep)
        iatm += 1
    #Backbone bonds
    nbnd = na_bbone - 1
    for i in range(1, nbnd + 1):
Beispiel #3
0
theta = (45.0 / 180.0) * math.pi  #Avg. initial bond angle

#Loop over all chains
iatm = 0
ibnd = 0
iang = 0  #Index of the last atom, bond, etc. added
for imol in range(1, num_mols + 1):
    iatm_beg = iatm + 1
    ibnd_beg = ibnd + 1
    iang_beg = iang + 1
    #First atom can be at any location
    iatm = config.append_atom_unbonded(atm_t_m, 0.0, sep=sep)
    #Add second atom bonded to the first as a freely jointed link
    iatm = config.append_atom_bonded(atm_t_m,
                                     0.0,
                                     len_bond,
                                     'efjc',
                                     iatm,
                                     sep=sep)
    #Add rest of the atoms as freely rotating links
    for i in range(3, natm + 1):
        iatm = config.append_atom_bonded(atm_t_m,
                                         0.0,
                                         len_bond,
                                         'efrc',
                                         iatm,
                                         im2=iatm - 1,
                                         theta=theta,
                                         sep=sep)
    #Add bonds
    for i in range(1, nbnd + 1):
        j = iatm_beg + i - 1