Granular materials are special materials, from the continuum-mechanical viewpoint, in the sense that they possess a clear microstructure of grains and intergrain contacts. In addition, the grains have translational as well as rotational degrees of freedom. Here a micromechanical expression is formulated for the average displacement gradient tensor in terms of the grain displacements and rotations for the two-dimensional case. It is based on a tessellation of the granular assembly into closed loops, along whose boundary the displacement field is defined in terms of the grain displacements and rotations. An important consideration for this expression is that it must satisfy the surface-additivity property, according to which the average displacement gradient of a combined two-dimensional surface is determined by the average displacement gradients of the constituent surfaces (and weighted by their areas). The developed micromechanical expression is verified by comparing its results with the macroscopic deformation as determined from the displacements at the boundary. Results of DEM simulations of a biaxial test (where the average rotation is equal to zero) and a shear test (where the average rotation is not equal to zero) are employed for this verification. The developed micromechanical expression for the displacement gradient is subsequently used to study deformation patterns in a complex case of a biaxial test where a shear band is formed.