1.4.2. PySetVoronoi

1.4.2.1. 概览

PySetVoronoi是用于扩展超椭球(poly-superellipsoids)及任意形状颗粒点云数据的点集Voronoi剖分程序。其核心有C++编写,源代码开源在 GitHub

../../_images/cover.png
  1. 特性
    • 任意形状颗粒集合体的Voronoi剖分

    • 可计算独立胞元的基本几何信息

    • 胞元形状的常用Minkowski张量

    • 支持独立胞元vtk和pov文件导出

    • OpenMP并行计算

    • Python脚本计算

  2. 支持平台
    • [x] Windows

    • [x] Linux

    • [x] MacOS

1.4.2.2. 安装

1) 二进制包

可在Github上下载编译好的二进制包到本地。

2) 编译安装

编译器需要支持C++17标准,并按照如下步骤在终端命令行进行编译安装(默认在源代码根目录创建文件夹 ‘build’ ):

1cd PySetVoronoi/
2mkdir build
3cd build
4cmake ../src
5make
6make install

注意: ‘make install’ 默认将编译后的库安装到与 ‘build’ 同一父目录的 install 文件夹。编译成功后,可在终端命令行测试示例:

1python3 testsp.py

1.4.2.3. 示例

 1import sys,os,os.path
 2sys.path.insert(1, '../../install/lib')
 3#os.environ['OMP_NUM_THREADS']=str(2)
 4import setvoronoi as sv
 5#print cf.__doc__
 6#establish a factory (class) to handle the computation
 7mycf = sv.CellFactory()
 8#this folder contains point-cloud data for each particle (will be generated)
 9mycf.infolder = "./input"
10#this folder contains data after computation
11mycf.outfolder = "./output"
12#particle data with info such as position, orientation, etc
13mycf.posFile = "./Particles.dat"
14#wall data with positions of each walll for a cubic container
15mycf.wallFile = "./Walls.dat"
16mycf.cellVTK = True #yield vtk files for cells
17mycf.cellPOV = True #yield pov files for cells
18#the parameter used to scale up the data during computation (due to a bug in vtk)
19mycf.scale = 1000
20#the parameter used to scale up the AABB box of a given particle
21mycf.boxScale = 2.0
22#shrink particles inward to avoid contact particles (with intersection in DEM)
23mycf.parShrink = 0.1e-3
24mycf.threadNum = 2 #threads in OpenMP
25#id list of particle/cell that will be visualized by vtk/pov, empty for all.
26mycf.visualized_ids = [0,1,2]
27#you can execute it step by step
28#point-cloud generation. here you can put your raw data
29mycf.genPointClouds(w_slices=30,h_slices=20)
30mycf.neighborSearch()
31#mycf.processing()#processing all particles
32pid = 0 #as a demonstrate, we calculate only a single particle with id = 0.
33mycf.processingOne(pid)#processing only one particle with id of pid
34#or you can conduct an automatic work flow
35#the following line will execute all processes starting from point-cloud generation.
36#mycf.autoWorkFlow()

1.4.2.4. 许可

1) 开源许可

PySetVoronoi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PySetVoronoi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the code. If not, see <http://www.gnu.org/licenses/>.

Note: The source codes of the thirdparty libraries (Eigen, Voro++, Pybind11) have been presented here, and their licenses are distributed with the source codes.

2) 引用本工作

如果您使用本程序并发表相关研究工作,请考虑引用如下之一的论文:

  • Zhang, C., Zhao, S., Zhao, J., Zhou, X., 2021. Three-dimensional Voronoi analysis of realistic grain packing: An XCT assisted set Voronoi tessellation framework. Powder Technology 379, 251–264.

  • Zhao, S., Zhao, J., Guo, N., 2020. Universality of internal structure characteristics in granular media under shear. Phys. Rev. E 101, 012906.

  • Zhao, S., Evans, T.M., Zhou, X., 2018. Three-dimensional Voronoi analysis of monodisperse ellipsoids during triaxial shear. Powder Technology 323, 323–336.