Strain gradient-induced diffusion of hydrogen in palladium and nickel membranes