Local rheology of suspensions and dry granular materials