Finite-Element Nonlinear Dynamics of Flexible Structures in Three Dimensions