MantisBT - ParaView
View Issue Details
0015894ParaView(No Category)public2015-12-19 09:562016-08-12 09:59
Nico Schlömer 
Kitware Robot 
normalminorhave not tried
closedmoved 
 
 
TBD
incorrect functionality
0015894: vtkExodusIIWriter: _ (underscore) added only to 2D data arrays
When writing 1D or 3D data arrays, the name of the array is preserved in the output file. When writing 2D data arrays, however, an underscore (_) is added to the name.

MWE:
```
import numpy
import vtk
from vtk.util import numpy_support

points = [
    [0.0, 0.0, 0.0],
    [1.0, 0.0, 0.0],
    [1.0, 1.0, 0.0],
    ]

mesh = vtk.vtkUnstructuredGrid()

# set points
vtk_points = vtk.vtkPoints()
# Not using a deep copy here results in a segfault.
vtk_array = vtk.util.numpy_support.numpy_to_vtk(points)
vtk_points.SetData(vtk_array)
mesh.SetPoints(vtk_points)

c = numpy.array([
    3,
    0, 1, 2,
    ], dtype=int)
a = vtk.util.numpy_support.numpy_to_vtkIdTypeArray(c)

cell_array = vtk.vtkCellArray()
cell_array.SetCells(1, a)
mesh.SetCells(vtk.VTK_TRIANGLE, cell_array)

# add point data
pd = mesh.GetPointData()

A = numpy.array([7, 3, -2], dtype=float)
array = vtk.util.numpy_support.numpy_to_vtk(A)
array.SetName('A')
pd.AddArray(array)

B = numpy.array([[7, 1], [3, 2], [-2, 0]], dtype=float)
array = vtk.util.numpy_support.numpy_to_vtk(B)
array.SetName('B')
pd.AddArray(array)

C = numpy.array([[7, 1, 3], [3, 2, -2], [-2, 0, 7]], dtype=float)
array = vtk.util.numpy_support.numpy_to_vtk(C)
array.SetName('C')
pd.AddArray(array)

# writer = vtk.vtkUnstructuredGridWriter()
# writer.SetFileName('test.vtk')

writer = vtk.vtkExodusIIWriter()
writer.SetFileName('test.e')

writer.SetInputData(mesh)
writer.Write()
```
Open the file in, e.g., ParaView and observe the difference between A, B_, C.

When using the `vtkUnstructuredGridWriter` to write VTK files (any other file type, in fact), no underscore is added.
No tags attached.
Issue History
2015-12-19 09:56Nico SchlömerNew Issue
2016-08-12 09:59Kitware RobotNote Added: 0038957
2016-08-12 09:59Kitware RobotStatusbacklog => closed
2016-08-12 09:59Kitware RobotResolutionopen => moved
2016-08-12 09:59Kitware RobotAssigned To => Kitware Robot

Notes
(0038957)
Kitware Robot   
2016-08-12 09:59   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current ParaView Issues page linked in the banner at the top of this page.