  We present three-dimensional global numerical simulations of the cosmic-ray
(CR) driven dynamo in barred galaxies. We study the evolution of the
interstellar medium of the barred galaxy in the presence of non-axisymmetric
component of the potential, i.e., the bar. The magnetohydrodynamical dynamo is
driven by CRs, which are continuously supplied to the disk by supernova (SN)
remnants. No magnetic field is present at the beginning of simulations but
one-tenth of SN explosions is a source of a small-scale randomly oriented
dipolar magnetic field. In all models we assume that 10% of 10^51 erg SN
kinetic energy output is converted into CR energy. To compare our results
directly with the observed properties of galaxies, we construct realistic maps
of polarized radio emission. The main result is that the CR-driven dynamo can
amplify weak magnetic fields up to a few {\mu}G within a few Gyr in barred
galaxies. The obtained e-folding time is equal to 300 Myr and the magnetic
field reaches equipartition at time t ~ 4.0 Gyr. Initially, the completely
random magnetic field evolves into large-scale structures. An even
(quadrupole-type) configuration of the magnetic field with respect to the
galactic plane can be observed. Additionally, the modeled magnetic field
configuration resembles maps of the polarized intensity observed in barred
galaxies. Polarization vectors are distributed along the bar and between spiral
arms. Moreover, the drift of magnetic arms with respect to the spiral pattern
in the gas density distribution is observed during the entire simulation time.
