基于可视化库(VTK)可视化技术的特点,讨论可视化流水线机制和并行程序的基本结构。针对计算流体力学可视化后处理实现的问题,介绍和使用VTK颜色映射算法,并编写对计算流体力学结果数据彩色云图显示的程序。然后为了解决时间开销大的问题,提出了并行显示算法。该算法充分利用VTK任务间的并行性,减少程序运行时间,提高运行效率。最后在多核环境下,对大小不同的文件彩色云图显示的加速比进行了对比分析。实验结果显示了随压力变化的彩色云图,表明基于VTK可视化技术能满足可视化后处理方面的要求,与信息传递接口(MPI)结合能取得很好的并行效果。
Visual pipeline mechanism and basic structure of the parallel program were discussed based on the characteristics of Visualization ToolKit (VTK). Since the problem of visualization post-processing in computational fluid dynamics, VTK color mapping algorithm was introduced and a program of showing nephogram was written. In order to reduce the running time, a parallel algorithm was proposed. The proposed algorithm made full use of the parallelism between the VTK tasks, reduced the program running time and improved the running efficiency. Finally the speedup ratios of flies of different sizes were compared and analyzed. The results show that the requirements of visualization post-processing is satisfied by visualization technology based on VTK and the good parallel effect is obtained with Message Passing Interface (MPI).