We investigate the dynamics in one-dimensional (1D) and two dimensional (2D) mesoscopic superconductors in an external magnetic field using the time-dependent Ginzburg-Landau equations. We analyze the different transitions between metastable states and describe the creation of topological defects that occur as the phase of the Ginzburg-Landau order parameter makes finite …