Volume and pressure dependence of ground-state and lattice-dynamical properties ofBaF2from density-functional methods