Magnetic structures combining different functions