Coloring by a Cell Vector Field
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When coloring by a cell vector field, it does not appear to be coloring correctly. I assume it's supposed to be coloring by Vector Magnitude since that's what the scalar bar says, but it's definitely not doing that. The scalar bar initially had an all-positive range, but after toggling it's visibility a few times, the range changed to include negative numbers (I didn't think this should happen with magnitudes)
I used the following programmable filter to calculate vector magnitudes and the coloring does not match coloring by the vector itself:
input=self.GetUnstructuredGridInput() output=self.GetUnstructuredGridOutput() output.ShallowCopy(input)
for i in xrange(0,input.GetCellData().GetNumberOfArrays()): # make new arrays for each component array=input.GetCellData().GetArray(i) newArray=paraview.vtkAbstractArray.CreateArray(array.GetDataType()) newArrayName=array.GetName()+"__Mag" for c in xrange(0,input.GetNumberOfCells()): sum=0 for x in xrange(0,array.GetNumberOfComponents()): sum=sum+(array.GetValue(c,x)*array.GetValue(c,x)) newArray.InsertNextValue(sqrt(sum)) output.GetCellData().AddArray(newArray)