Flexible and rigid macromolecules in shear and electric fields