We compute numerical solutions of Liouville's equation with a discontinuous Hamiltonian. We assume that the underlying Hamiltonian system has a well-defined behaviour even when the Hamiltonian is discontinuous. In the case of geometrical optics such a discontinuity yields the familiar Snell's law or the law of specular reflection. Solutions to Liouville's equation should be constant along curves defined by the Hamiltonian system. This consideration allows us to derive a new jump condition, enabling us to construct a first-order accurate scheme. Essentially, the correct physics is built into the solver. The scheme is tested in a two-dimensional optical setting with two test cases, the first using a single jump in the refractive index and the second a compound parabolic concentrator. For these two situations, the scheme outperforms more conventional methods such as ray tracing.
Keywords: Liouville's equation, Hamiltonian systems, jump condition, upwind scheme, geometrical optics, phase space