Particle simulations confined by sharp walls usually develop an oscillatory density profile. For some applications, most notably soft matter liquids, this behavior is often unrealistic and one expects a monotonic density climb instead. To reconcile simulations with experiments, we propose mirror-and-shift boundary conditions where each interface is mapped to a distant part of itself. The main result is that the particle density increases almost monotonically from zero to bulk, over a short distance of about one particle diameter. The method is applied to simulate a polymer brush in explicit solvent, grafted on a flat silicon substrate. The simulated density profile agrees favorably with neutron reflectometry measurements and self-consistent field theory results.