@氕氘-川 批量保存的脚本老报错: ERROR: In C:\bbd\df0abce0\build\paraview\src\paraview\ParaViewCore\VTKExtensions\Default\vtkCSVWriter.cxx, line 82
vtkCSVWriter (000001F6DAFC08C0): Unable to open file: /-0.1150.csv
ERROR: In C:\bbd\df0abce0\build\paraview\src\paraview\ParaViewCore\VTKExtensions\Default\vtkCSVWriter.cxx, line 82
vtkCSVWriter (000001F6DAFCC8C0): Unable to open file: /-0.0650.csv
...
这是我的脚本:
import numpy as np
from paraview import numpy_support as ns
import paraview as pv
import paraview.simple as ps
afoam = FindSource('a.foam')
for y in np.arange(-0.115,0.115,0.05):
# Make a cut of the wing to have a local 2D profile
Slice1 = Slice( Input=afoam )
Slice1.SliceType = "Plane"
Slice1.Triangulatetheslice = 0
Slice1.SliceOffsetValues = [0.0]
Slice1.SliceType.Origin = [0.0, y, 0.0]
Slice1.SliceType.Normal = [0.0, 1.0, 0.0]
descriptiveStatistics1 = DescriptiveStatistics(Slice1)
descriptiveStatistics1.VariablesofInterest = ['T']
descriptiveStatistics1.AttributeMode = 0
Render()
writer = CreateWriter(str(y)+".csv",OutputPort(descriptiveStatistics1, 1))
writer.FieldAssociation = "Cells"
writer.UpdatePipeline()
del writer
#SaveData(str(y)+".csv", proxy=OutputPort(descriptiveStatistics1, 1), FieldAssociation='Cells')
descriptiveStatistics1.UpdatePipeline()