Molecular dynamics and Enskog theory calculation of one dimensional problems in the dynamics of dense gases