The combination of density functional (DF) theory with molecular dynamics (MD) allows one to simulate dynamical processes in solids, clusters and molecules without requiring a parameterization of the forces in the system. The method can also be used with the strategy of ''simulated annealing'' to determine structural isomers. We demonstrate the capabilities of the scheme in the case of the structure of neutral and charged phosphorus clusters, and discuss relationship between these structures and those of bulk systems (crystalline and amorphous). The results show clearly the tendency of phosphorus structures to have threefold coordination as well as ''tubular'' structures similar to that found in Hittorf's phosphorus (H-P). We discuss the interplay between electronic and geometric structure.