【问题标题】:vtk filter for OpenFOAMOpenFOAM 的 vtk 过滤器
【发布时间】:2020-04-23 16:06:11
【问题描述】:

我想使用 python-vtk 通过阈值过滤压力

    import vtk
    filename = "a.foam"

    reader = vtk.vtkOpenFOAMReader()
    reader.SetFileName(filename)
    reader.CreateCellToPointOn()
    reader.DecomposePolyhedraOn()
    reader.EnableAllCellArrays()
    reader.Update()

    tArray = vtk_to_numpy(reader.GetTimeValues())
    reader.UpdateTimeStep(tArray[-1]) 
    reader.Update()

    filter_threshold = vtk.vtkThreshold()
    filter_threshold.SetInputConnection(reader.GetOutputPort()) 

我应该如何在过滤器类上选择“压力”?

【问题讨论】:

    标签: python vtk openfoam


    【解决方案1】:

    【讨论】:

    • 谢谢 可能已解决 """ filter_threshold = vtk.vtkThreshold() filter_threshold.SetInputConnection(reader.GetOutputPort()) filter_threshold.ThresholdByLower(1.0) filter_threshold.ThresholdByUpper(100.0) FIELD_ASSOCIATION_POINTS = 0 filter_threshold。 SetInputArrayToProcess(0,0,0,FIELD_ASSOCIATION_POINTS,"alpha") filter_threshold.Update() """
    猜你喜欢
    • 1970-01-01
    • 2021-10-19
    • 2015-06-13
    • 2018-05-06
    • 2013-12-29
    • 2022-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多