An Efficient Model for Numerical Simulation of the Mechanical Behavior of Soils. Part 1: Theory and Numerical Algorithm