Optimal structure design of permanent magnet motors based on a general pattern of rotor topologies