Libstatmech And Applications To Astrophysics