Cosmological density field generator supporting CIC, TSC (for GADGET and ART) and proper SPH (for GADGET) particle to grid mapping