Beispiel #1
0
                                              len_bond,
                                              'efjc',
                                              ibp,
                                              sep=sep)
                    iatm += 1
                    config.add_bond(bnd_t_bs, ibp, iatm - 1)
                    ibnd += 1
                    ia_br_beg = iatm - 1
                else:
                    config.append_atom_bonded(atm_t_sc,
                                              0.0,
                                              len_bond,
                                              'efjc',
                                              iatm - 1,
                                              sep=sep)
                    iatm += 1
                    config.add_bond(bnd_t_ss, iatm - 2, iatm - 1)
                    ibnd += 1
            #Set branch
            config.set_branch(ibp, ia_br_beg, na_sc)

    #Add molecule
    config.add_molecule(1, iatm - 1, iatm_beg, ibnd - 1, ibnd_beg, 0, 0, 0, 0)

config.update_simbox()
config.to_center(1)
config.add_flow_field(0, np.array([]))

write_ldf(config, 'tfr.txt', title='test_brush')
write_cfg(config, 'bb-sus-%d-%d.cfg' % (na_bbone, na_sc), title='brush')
Beispiel #2
0
sep = 1.95  # Must be <= len_bond

#Loop over all molecules
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_A + 1):
    iatm_beg = iatm
    ibnd_beg = ibnd
    iang_beg = iang

    config.append_atom_unbonded(atm_t_a, 1.0, sep=sep)
    iatm += 1

    config.add_molecule(mol_t_A, natm, iatm_beg, 0, ibnd_beg, 0, iang_beg, 0,
                        0)

for imol in range(1, num_mols_B + 1):
    iatm_beg = iatm
    ibnd_beg = ibnd
    iang_beg = iang

    config.append_atom_unbonded(atm_t_b, -1.0, sep=sep)
    iatm += 1

    config.add_molecule(mol_t_B, natm, iatm_beg, 0, ibnd_beg, 0, iang_beg, 0,
                        0)

config.apply_pbc()

write_ldf(config, 'tfr.txt', title='test_frame')
Beispiel #3
0
    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]) )

write_ldf(config, 'tfr.txt', title='test_frame')
write_cfg(config, 'lin-%d.cfg'%natm, title='test_cfg')
Beispiel #4
0
                                         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)
#No bonds & angles. Let's keep sep same as before. Put these counterions
#randomly within the box.
for imol in range(1, num_mols + 1):
    iatm_beg = iatm + 1
    iatm = config.append_atom_unbonded(atm_t_c, 0.0, sep=sep)
    #Add the whole molecule
    config.add_molecule(mol_t_ci, 1, iatm_beg, 0, 0, 0, 0, 0, 0)

#Randomly assign charge, while keeping the whole system neutral.