Automated free-energy calculation from atomistic simulations