Stellar GADGET: A smooth particle hydrodynamics code for stellar