An absorbing boundary condition for regular and irregular wave simulations