We investigate a class of spatially compact inhomogeneous spacetimes. Motiv
ated by Thurston's geometrization conjecture, we give a formulation for con
structing spatially compact composite spacetimes as solutions for the Einst
ein equations. Such composite spacetimes are built from the spatially compa
ct locally homogeneous vacuum spacetimes which have two commuting local Kil
ling vector fields and are homeomorphic to torus bundles over the circle by
gluing them through a timelike hypersurface admitting a homogeneous spatia
l torus spanned by the commuting local Killing vector fields, We also assum
e that the matter which will arise from the gluing is compressed on the bou
ndary, i.e, we take the thin-shell approximation. By solving the junction c
onditions, we can see dynamical behaviour of the connected (composite) spac
etime. The Teichmuller deformation of the torus can also be obtained. We ap
ply our formalism to a concrete model. The relation to the torus sum of 3-m
anifolds and the difficulty of this problem are also discussed.