提取非结构化栅格数据集的时间步长数据

时间:2018-02-26 12:38:25

标签: python paraview

我在非结构化栅格数据集的时间序列中有标量数据。我想提取特定时间步的数据。我尝试了下面的内容,但似乎只是第一次获取信息:

from paraview.simple import *
from vtk.util.numpy_support import vtk_to_numpy

AllFiles = ['File01.vtk', 'File02.vtk', 'File03.vtk']
Reader = LegacyVTKReader(FileNames = AllFiles)
TimeSteps = ExtractTimeSteps(Input = Reader, TimeStepIndices = [3])

Output = servermanager.Fetch(TimeSteps)
Results = vtk_to_numpy(Output.GetPointData().GetScalars('incremental_deviatoric_strain_solid'))

print(Results)

我做错了什么?如何获取感兴趣的时间步骤的数据?

修改

以下是我正在查看的文件的简化版本:

# vtk DataFile Version 3.0
test-1001
ASCII
DATASET UNSTRUCTURED_GRID
POINTS     60 float
  5.000000000000000E-002  2.500000000000000E-002  2.500000000000000E-002
  2.500000000000000E-002  5.000000000000000E-002  7.500000000000001E-002
CELLS      60     120
1      0
1      1
CELL_TYPES     60
 1
 1
POINT_DATA      60
SCALARS pressure_liquid float 1
LOOKUP_TABLE default
  0.000000000000000E+000
  0.000000000000000E+000
SCALARS incremental_volumetric_strain_solid float 1
LOOKUP_TABLE default
 -1.145559391544503E-019
 -1.230639697632887E-019

0 个答案:

没有答案