Adding Environmental Gas Physics to the Semianalytic Method for Galaxy Formation: Gravitational Heating | Synapse