Finite element analysis of long-period water waves