Formation and construction of shock for p -system