我试图用Mayavi的流函数精确地可视化一些CFD数据。我有六个100x100x100数组(X,Y,Z,U,V,W),与被分析粒子的位置和速度有关。它们是从单列数组中创建的numpy.meshgrid. 在
当我输入三个数组(如U、V和W)时,图会很好地显示出来,但在本例中,可视化缺少其余的数据。
当我输入所有六个数组时,3D打印出来的是一条直线。在
我的问题是:如何输入所有六个数组并得到一个工作流程图?更具体地说,有人能解释一下下面的内容吗?Flow documentation的节选?在
"the positions of the arrows are assumed to be the indices of the corresponding points in the (u, v, w) arrays."
流程文档如下:
因此,为了使用六个输入数组成功地绘制Flow函数,必须使用
numpy.mgrid
创建前三个由于X、Y和Z已经指定为一维数组,因此我的代码如下所示:
Xgrid, Ygrid, Zgrid = np.mgrid[X[1]:X[-1]:50j,Y[1]:Y[-1]:50j,Z[1]:Z[-1]:50j]
注意:}不同。在
numpy.mgrid
与{相关问题 更多 >
编程相关推荐