コード例 #1
0
ファイル: create-chn-ub.py プロジェクト: saridut/BROWNPAK
    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
    
    config.add_molecule(1, natm, iatm_beg, nbnd, ibnd_beg, nang, iang_beg, 0, 0)

#config.add_tether(teth_t, 1, np.zeros((3,)) )

config.update_simbox()
config.to_center(1)

config.add_flow_field( 1, np.array([0.1]) )
コード例 #2
0
    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):
        config.add_bond(bnd_t_bb, i, i + 1)
        ibnd += 1

    #Set backbone branch
    config.set_branch(-1, 1, na_bbone)

    #Side chains (arranged as efjc)
    for i in range(1, na_bbone + 1, na_sp + 1):
        ibp = i  #Branch point
        for i_sc in range(1, f + 1):
            for ia_sc in range(1, na_sc + 1):
                if ia_sc == 1:
                    config.append_atom_bonded(atm_t_sc,
                                              0.0,
                                              len_bond,
                                              'efjc',
コード例 #3
0
                                     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
        ibnd = config.add_bond(bnd_t_chn, j, j + 1)

    #Add angles
    for i in range(1, nang + 1):
        j = iatm_beg + i - 1
        iang = config.add_angle(ang_t_chn, j, j + 1, j + 2)

    #Add the whole molecule
    config.add_molecule(mol_t_chn, natm, iatm_beg, nbnd, ibnd_beg, nang,
                        iang_beg, 0, 0)

#Now add counterions. These are monoatomic molecules. Let's keep their name same
#as the atomic species.
#Let there be 50 counterions.
num_mols = 50
mol_t_ci = config.add_molecule_type('C', num_mols)