We derive a new class of exact solutions characterized by the Szekeres-Szaf
ron metrics (of class I), admitting in general no isometries. The source is
a fluid with viscosity but zero heat flux (adiabatic but irreversible evol
ution) whose equilibrium state variables satisfy the equations of state of:
(a) an ultra-relativistic ideal gas; (b) a non-relativistic ideal gas; (c)
a mixture of (a) and (b). Einstein's held equations reduce to a quadrature
that is integrable in terms of elementary functions (cases (a) and (c)) an
d elliptic integrals (case (b)). Necessary and sufficient conditions are pr
ovided for the viscous dissipative stress and equilibrium variables to be c
onsistent with the theoretical framework of extended irreversible thermodyn
amics and kinetic theory of the Maxwell-Boltzmann and radiative gases. Ener
gy and regularity conditions are discussed. We prove that a smooth matching
can be performed along a spherical boundary with a Friedmann-Lemaitre-Robe
rtson-Walker (FLRW) cosmology or with a Vaidya exterior solution. Possible
applications are briefly outlined.