Paraview求助,操作出现问题了
-
各位大佬,想请教一下paraview操作的问题,突然无法运行了,然后重新下载了一个新版本,还是有这个问题,这个是运行时候的错误提示,能不能帮我指导处理一下,谢谢各位了。
Generic Warning: In vtkSMColorMapEditorHelper.cxx, line 3180
Failed to determine the LookupTable being used.Generic Warning: In vtkSMColorMapEditorHelper.cxx, line 3180
Failed to determine the LookupTable being used.Traceback (most recent call last):
File "F:\OpenFOAM\ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64\ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\servermanager.py", line 3273, in GetAssociationFromString
return ASSOCIATIONS[val]
KeyError: 'NONE'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\OpenFOAM\ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64\ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\servermanager.py", line 3276, in GetAssociationFromString
return _LEGACY_ASSOCIATIONS[val]
KeyError: 'NONE'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 217, in <module>
File "F:\OpenFOAM\ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64\ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\simple.py", line 1082, in ColorBy
rep.SetScalarColoring(None, servermanager.GetAssociationFromString(association))
File "F:\OpenFOAM\ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64\ParaView-5.13.1-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\servermanager.py", line 3278, in GetAssociationFromString
raise RuntimeError("invalid association string '%s'" % val)
RuntimeError: invalid association string 'NONE' -
这个是另一个版本的,提示的问题
Generic Warning: In vtkSMColorMapEditorHelper.cxx, line 772
Failed to determine the LookupTable being used.Generic Warning: In vtkSMColorMapEditorHelper.cxx, line 772
Failed to determine the LookupTable being used.Traceback (most recent call last):
File "F:\OpenFOAM\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64-2\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\servermanager.py", line 3203, in GetAssociationFromString
return ASSOCIATIONS[val]
KeyError: 'NONE'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\OpenFOAM\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64-2\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\servermanager.py", line 3206, in GetAssociationFromString
return _LEGACY_ASSOCIATIONS[val]
KeyError: 'NONE'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 217, in <module>
File "F:\OpenFOAM\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64-2\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\simple.py", line 791, in ColorBy
rep.SetScalarColoring(None, servermanager.GetAssociationFromString(association))
File "F:\OpenFOAM\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64-2\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\servermanager.py", line 3208, in GetAssociationFromString
raise RuntimeError ("invalid association string '%s'" % val)
RuntimeError: invalid association string 'NONE' -
但是在另一台电脑上,两个版本都能用。裂开了。是不是这台电脑的什么文件不合适了?有没有大佬能指导一下,5555555555555555555555,裂开了。
-
def GetAssociationFromString(val):
"""Returns array association integer value from its string representation"""
global ASSOCIATIONS, _LEGACY_ASSOCIATIONS
val = str(val).upper()
try:
return ASSOCIATIONS[val]
except KeyError:
try:
return _LEGACY_ASSOCIATIONS[val]
except KeyError:
raise RuntimeError ("invalid association string '%s'" % val)这个是“ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64-2\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\simple.py"的
第3198到3208行代码
-
"ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64-2\ParaView-5.12.0-MPI-Windows-Python3.10-msvc2017-AMD64\bin\Lib\site-packages\paraview\simple.py"
第790-792行:
if value == None: rep.SetScalarColoring(None, servermanager.GetAssociationFromString(association)) return
第786-826行代码:
rep.UseSeparateColorMap = separate
association = rep.ColorArrayName.GetAssociation()
arrayname = rep.ColorArrayName.GetArrayName()
component = None
if value == None:
rep.SetScalarColoring(None, servermanager.GetAssociationFromString(association))
return
if not isinstance(value, tuple) and not isinstance(value, list):
value = (value,)
if len(value) == 1:
arrayname = value[0]
elif len(value) >= 2:
association = value[0]
arrayname = value[1]
if len(value) == 3:
# component name provided
componentName = value[2]
if componentName == "Magnitude":
component = -1
else:
if association == "POINTS":
array = rep.Input.PointData.GetArray(arrayname)
if association == "CELLS":
array = rep.Input.CellData.GetArray(arrayname)
if array:
# looking for corresponding component name
for i in range(0, array.GetNumberOfComponents()):
if componentName == array.GetComponentName(i):
component = i
break
# none have been found, try to use the name as an int
if i == array.GetNumberOfComponents() - 1:
try:
component = int(componentName)
except ValueError:
pass
if component is None:
rep.SetScalarColoring(arrayname, servermanager.GetAssociationFromString(association))
else:
rep.SetScalarColoring(arrayname, servermanager.GetAssociationFromString(association), component)
rep.RescaleTransferFunctionToDataRange()