Hydrodynamic simulation technique from solid to gas