Smart design of porous Ni and Ni-W films with tunable mechanical and magnetic performance