Geomechanics and poromechanics of earthquakes