Open resonators and open waveguides