Non-periodic boundary conditions for ab initio molecular dynamics in condensed phase using localized basis functions