Polymeric foam–ferromagnet composites as smart lightweight materials