Terahertz wave switch based on photonic crystal ring resonators