A penalty function approach for the nonlinear finite element analysis of thin shells