Numerical methods in rock mechanics