  We investigate a class of spatially compact inhomogeneous spacetimes.
Motivated by Thurston's Geometrization Conjecture, we give a formulation for
constructing spatially compact composite spacetimes as solutions for the
Einstein equations. Such composite spacetimes are built from the spatially
compact locally homogeneous vacuum spacetimes which have two commuting Killing
vectors by gluing them through a timelike hypersurface admitting a homogeneous
spatial slice spanned by the commuting Killing vectors. Topology of the spatial
section of the timelike boundary is taken to be the torus. We also assume that
the matter which will arise from the gluing is compressed on the boundary, i.e.
we take the thin-shell approximation. By solving the junction conditions, we
can see dynamical behavior of the connected (composite) spacetime. The
Teichm\"uller deformation of the torus also can be obtained. We apply our
formalism to a concrete model. The relation to the torus sum of 3-manifolds and
the difficulty of this problem are also discussed.
