Abstract. We present the results of the three-dimensional, fully non-linear MHD simulations of the large-scale magnetic field evolution in a barred galaxy with the back reaction of magnetic field to gas. We also include the process of the cosmic-ray driven dynamo. In addition, we check what physical processes are responsible for the magnetic field evolution in the tidally influenced spiral galaxies. We solve the MHD equations for the gas and magnetic field in a spiral galaxy with gravitationally prescribed bulge, disk and halo which travels along common orbit with the second body. In order to compare our modeling results with the observations we also construct the maps of high-frequency (Faraday rotation-free) polarized radio emission from the simulated magnetic fields. The model accounts for the effects of projection and limited resolution.We found that the obtained magnetic field configurations are highly similar to the observed maps of the polarized intensity of barred galaxies, because the modeled vectors form coherent structures along the bar and spiral arms. We also found a physical explanation of the problem of inconsistency between the velocity and magnetic fields character present in this type of galaxies. Due to the dynamical influence of the bar, the gas forms spiral waves which go radially outward. Each spiral arm forms the magnetic arm which stays much longer in the disk than the gaseous spiral structure. The modeled total energy of magnetic field and magnetic flux grows exponentially due to the action of the cosmic-ray driven dynamo. We also obtained the polarization maps of tidally influenced spiral galaxies which are similar to observations.