A finite element algorithm for the study of nonlinear standing waves