Efficient and scalable simulation of solids and fluids