Locking-free finite element methods for linear and nonlinear elasticity in 2D and 3D