华南理工大学学报(自然科学版) ›› 2011, Vol. 39 ›› Issue (7): 150-155.doi: 10.3969/j.issn.1000-565X.2011.07.025

• 计算机科学与技术 • 上一篇    下一篇

基于GPU 的面向SPH 流体模拟的邻居查找算法

赵相坤 李凤霞 战守义   

  1. 北京理工大学 北京市智能信息技术实验室,北京 100081
  • 收稿日期:2010-09-20 修回日期:2011-02-23 出版日期:2011-07-25 发布日期:2011-06-03
  • 通信作者: 赵相坤(1971-) ,男,博士,讲师,主要从事虚拟现实与仿真研究. E-mail:jnzhaoxk@yahoo.com.cn
  • 作者简介:赵相坤(1971-) ,男,博士,讲师,主要从事虚拟现实与仿真研究.
  • 基金资助:

    国防基础科研项目( B2220061084)

GPU-Based Neighbor Search Algorithm for SPH Fluid Simulations

Zhao Xiang-kun  Li Feng-xia  Zhan Shou-yi   

  1. Beijing Laboratory of Intelligent Information Technology,Beijing Institute of Technology,Beijing 100081,China
  • Received:2010-09-20 Revised:2011-02-23 Online:2011-07-25 Published:2011-06-03
  • Contact: 赵相坤(1971-) ,男,博士,讲师,主要从事虚拟现实与仿真研究. E-mail:jnzhaoxk@yahoo.com.cn
  • About author:赵相坤(1971-) ,男,博士,讲师,主要从事虚拟现实与仿真研究.
  • Supported by:

    国防基础科研项目( B2220061084)

摘要: 为了提高基于平滑粒子动力学( SPH) 的流体模拟速度,提出了一种在图形处理器( GPU) 上实现的基于网格的邻居快速查找算法.该方法首先使用粒子位置纹理信息建立对应的网格纹理,然后利用GPU 排序方法按照粒子的网格索引进行排序,最后在排序后的网格纹理中得到粒子的邻居粒子索引,并将其赋值到预计算的粒子邻接纹理中.该方法克服了像素着色器无法将指定数值写到指定位置的问题.将这种基于GPU 的邻居查找算法应用于流体模拟,可以使基于SPH 的流体模拟方法完全运行在GPU 上,成倍地提高流体模拟的速度.

关键词: 流体模拟, 邻居查找算法, 平滑粒子动力学, 图形处理器

Abstract:

In order to improve the fluid simulation speed based on the smoothed particle hydrodynamics ( SPH) ,a new grid-based neighbor search method realizing on the graphics processing unit ( GPU) is proposed. In this method,first,the particle grid map texture is created according to the particle position texture and is sorted according to the grid index of each particle via the CPU sorting method. Then,the particle neighbor index is obtained by searching the sorted grid map texture and is assigned to the pre-computed position of neighbor map texture. The proposed method overcomes the current inability of pixel shaders in terms of scatter operations. With the adoption of this new GPU-based neighbor search technology,SPH fluid simulation can be entirely implemented on GPU and the fluid simulation speed can be doubled.

Key words: fluid simulation, neighbor search algorithm, smoothed particle hydrodynamics, graphics processing unit