Thermodynamical properties of solids frommicroscopic theory : applications to MgF 2 andAl 2 O 3