Magnetic devices for welding