  We prove a compact embedding theorem in a class of spaces of piecewise H1
functions subordinated to a class of shape regular, but not necessarily
quasi-uniform triangulations of a polygonal domain. This result generalizes the
Rellich--Kondrachov theorem. It is used to prove generalizations to piecewise
functions of nonstandard Poincar\'e--Friedrichs inequalities. It can be used to
prove Korn inequalities for piecewise functions associated with elastic shells.
