Optimized Simulation of Granular Materials