An average atom code for warm matter: application to aluminum and uranium