A topological study of toroidal dynamics