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')
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) #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)