Absorbing Boundary Conditions For Scalar And Elastic Waves In The Time-Domain