  The Trefftz Discontinuous Galerkin (TDG) method is a technique for
approximating the Helmholtz equation (or other linear wave equations) using
piecewise defined local solutions of the equation to approximate the global
solution. When coefficients in the equation (for example, the refractive index)
are piecewise constant it is common to use plane waves on each element. However
when the coefficients are smooth functions of position, plane waves are no
longer directly applicable. In this paper we show how Generalized Plane Waves
(GPWs) can be used in a modified TDG scheme to approximate the solution for
piecewise smooth coefficients. GPWs are approximate solutions to the equation
that reduce to plane waves when the medium through which the wave propagates is
constant. We shall show how to modify the TDG sesquilinear form to allow us to
prove convergence of the GPW based version. The new scheme retains the high
order convergence of the original TDG scheme (when the solution is smooth) and
also retains the same number of degrees of freedom per element (corresponding
to the directions of the GPWs). Unfortunately it looses the advantage that only
skeleton integrals need to be performed. Besides proving convergence, we
provide numerical examples to test our theory.
