Predicting the Yield Stress of Geomaterials from Their Microstructure