Hydrogen mean force and anharmonicity in polycrystalline and amorphous ice