Caustics are a generic feature of the non-linear growth of structure in the dark matter distribution. If the dark matter were absolutely cold, its mass density would diverge at caustics, and the integrated annihilation probability would also diverge for individual particles participating in them. For realistic dark matter candidates, this behaviour is regularized by small but non-zero initial thermal velocities. We present a mathematical treatment of evolution from hot, warm or cold dark matter initial conditions which can be directly implemented in cosmological N-body codes. It allows the identification of caustics and the estimation of their annihilation radiation in fully general simulations of structure formation.