Calculation of the magnetostriction and thermal expansion of an itinerant-electron ferromagnet