Computational Mechanics of Arbitrarily Shaped Granular Materials