for i in range(num_molecule_copies):
        for j in range(dihedrals_per_mol):
            pid1, pid2, pid3, pid4, dihtypeid = dihedrals_tmp[j][0:5]
            ia=molstartindex+pid1 + (i * num_atoms_molecule) # index of copy atom i
            ib=molstartindex+pid2 + (i * num_atoms_molecule) # index of copy atom j