The nature and origin of turbulence and magnetic fields in the intergalactic space are important problems that are yet to be understood. We propose a scenario in which turbulent-flow motions are induced via the cascade of the vorticity generated at cosmological shocks during the formation of the large-scale structure. The turbulence in turn amplifies weak seed magnetic fields of any origin. Supercomputer simulations show that the turbulence is subsonic inside clusters and groups of galaxies, whereas it is transonic or mildly supersonic in filaments. Based on a turbulence dynamo model, we then estimated that the average magnetic field strength would be a few microgauss (mu G) inside clusters and groups, approximately 0.1 mu G around clusters and groups, and approximately 10 nanogauss in filaments. Our model presents a physical mechanism that transfers the gravitational energy to the turbulence and magnetic field energies in the large-scale structure of the universe