Stochastic boundary conditions for molecular dynamics simulations.