Simulation of the primary stage of the interaction of swift heavy ions with condensed matter