  We make use of a high-resolution zoom-in hydrodynamical simulation to
investigate the impact of filaments on galaxy formation in their residing dark
matter haloes. A method based on the density field and the Hoshen-Kopelman
algorithm is developed to identify filaments. We show that cold and dense gas
preprocessed by dark matter filaments can be further accreted into residing
individual low-mass haloes in directions along the filaments. Consequently,
comparing with field haloes, gas accretion is very anisotropic for filament
haloes. About 30 percent of the accreted gas of a residing filament halo was
preprocessed by filaments, leading to two different thermal histories for the
gas in filament haloes. Filament haloes have higher baryon and stellar
fractions when comparing with their field counterparts. Without including
stellar feedback, our results suggest that filaments assist gas cooling and
enhance star formation in their residing dark matter haloes at high redshifts
(i.e. z=4.0 and 2.5).
