  Partial differential equations are frequently solved using a global basis,
such as the Fourier series, due to excellent convergence. However, convergence
becomes impaired when discontinuities are present due to the Gibbs phenomenon,
negatively impacting simulation speed and possibly generating spurious
solutions. We resolve this by supplementing the smooth global basis with an
inherently discontinuous basis, incorporating knowledge of the location of the
discontinuities. The solution's discontinuities are reproduced with exponential
convergence, expediting simulations. The highly constrained discontinuous basis
also eliminates the freedom to generate spurious solutions. We employ the
combined smooth and discontinuous bases to construct a solver for the modes of
a resonator in an open electromagnetic system. These modes can then expand any
scattering problem for any source configuration or incidence condition without
further numerics, enabling ready access and physical insight into the spatial
variation of Green's tensor. Solving for the modes is the most numerically
intensive and difficult step of modal expansion methods, so our mode solver
overcomes the last major impediment to the use of modal expansion for open
systems.
