Converting a hex mesh into a fundamental mesh by inserting fundamental sheets is an effective means to improve the hex mesh's quality near the boundary. However, the high-quality and automatic fundamental sheets insertion is still a problem. In this paper, a method is proposed to automatically generate fundamental sheets with the support of stream surfaces. By establishing a constrained integer linear system, the types of fundamental sheets to be inserted are determined effectively and optimally. By constructing discrete stream surfaces associated with the relevant geometric entities, the optimized positions of fundamental sheets are automatically determined. The experimental results show that the proposed method can automatically insert high-quality fundamental sheets and effectively improve the elements' geometric quality of the hex mesh.