Multiscale theory and simulation of barium titanate