Law of the junction for degenerate material with position-dependent band gap and electron affinity