We study the influence of a finite container on an ideal gas. The trace of theheat kernel Θ(t) = Σ∞υ = 1exp(−tμυ), where {μυ}∞υ = 1are the eigenvalues of the negative Laplacian − ∇2 = − Σ3β = 1(∂/∂xβ)2 in the (x1, x2, x3)-space,is studied for a general bounded domain Ω with a smooth bounding surface S, where afinite number of Dirichlet, Neumann, and Robin boundary conditions on thepiecewise smooth parts S i (i = 1, ..., n) of S are considered such that S =U″i = 1S i . Some geometrical properties of Ω (the volume, the surface area, the meancurvature, and the Gaussian curvature) are determined. Furthermore,thermodynamic quantities, particularly the energy, for an ideal gas enclosed inthe general bounded domain Ω with Dirichlet, Neumann, and Robin conditionsare examined with the help of the asymptotic expansions of Θ(t) for short timet. We show that these thermodynamic quantities depend on some geometricproperties of Ω.