A quasistatic finite-difference method for calculating the effective elastic moduli of digital rock models