Numerical simulation in rock mechanics