Mechanical forces in magnetic fields