A model for granular materials is presented that describes both the internal deformation of each granule and the interactions between grains. The model, which is based on the FLIP-material point, particle-in-cell method, solves continuum constitutive models for each grain. Interactions between grains are calculated with a contact algorithm that forbids interpenetration, but allows separation and sliding and rolling with friction. The particle-in-cell method eliminates the need for a separate contact detection step. The use of a common rest frame in the contact model yields a linear scaling of the computational cost with the number of grains. The properties of the model are illustrated by numerical solutions of sliding and rolling contacts, and for granular materials by a shear calculation. The results of numerical calculations demonstrate that contacts are modeled accurately for smooth granules whose shape is resolved by the computation mesh. (C) 2000 Elsevier Science S.A. All rights reserved.