Simulating structured fluids with tensorial viscoelasticity.