The smoothed profile method is extended to study the rheological behaviour of colloidal dispersions under shear flow by using the Lees–Edwards boundary conditions. We start with a reformulation of the smoothed profile method, a direct numerical simulation method for colloidal dispersions, so that it can be used with the Lees–Edwards boundary condition, under steady or oscillatory-shear flow. By this reformulation, all the resultant physical quantities, including local and total shear stresses, become available through direct calculation. Three simple rheological simulations are then performed for (1) a spherical particle, (2) a rigid bead chain and (3) a collision of two spherical particles under shear flow. Quantitative validity of these simulations is examined by comparing the viscosity with that obtained from theory and Stokesian dynamics calculations. Finally, we consider the shear-thinning behaviour of concentrated colloidal dispersions.