Welding of ferrous and non-ferrous metals