Shape effect in the magnetostriction of ferromagnetic composite