Mechanics and thermodynamics in the cell