Recent observations of neutral Galactic interstellar medium showed that filamentary structures of H I clouds are aligned with the interstellar magnetic field . Many interesting applications are proposed based on the alignment such as measurement of magnetic field strength through the Chandrasekhar-Fermi method and removal of polarized foreground dust emissions for the detection of inflationary polarized emission in the cosmic microwave background radiation . However , the physical origin of the alignment remains to be explained . To understand the alignment mechanism , we examine formation of H I clouds triggered by shock compression of diffuse warm neutral medium using three-dimensional magnetohydrodynamic simulations with the effects of optically thin cooling and heating . We show that the shock-compressed diffuse interstellar medium of density n \sim 1 cm ^ { -3 } evolves into H I clouds with typical density n \sim 50 cm ^ { -3 } via thermal instability driven by cooling , which is consistent with previous studies . We apply a machine vision transformation developed by Clark et al . ( 2014 ) to the resulting column density structures obtained by the simulations in order to measure angle correlation between filamentary structures of H I clouds and magnetic field . We find that the orientation of H I filaments depends on the environmental turbulent velocity field , particularly on the strength of shear strain in the direction of the magnetic field , which is controlled by the angle between the shock propagation direction and upstream magnetic field . When the strain along the magnetic field is weak , filamentary components of H I clouds basically lie perpendicular to the magnetic field . However , the filaments have come to align with the magnetic field , if we enhance the turbulent strain along the magnetic field or if we set turbulence in the preshock medium .