Solution of the Riemann problem for a class of hyperbolic systems of conservation laws by the viscosity method