Encapsulation of FePt and FePt3 alloys inside carbon-foam materials