[Paraview] snappy display of inner points of large grid
Donjan Rodic
drodic at phys.ethz.ch
Wed May 3 16:38:01 EDT 2017
I'm visualising a large grid dataset with different regions == scalar
colors with ParaView 5.1.2 on Ubuntu 16.10.
The computation prints the colors (floats in [0,1]) of a 250^3 (usually
larger) grid into a CSV file:
x,y,z,color
0,0,0,0.5
0,0,1,0.5
0,0,2,0.3
...
I load it with ParaView (Python script), apply TableToPoints, set
points.XColumn = 'x', etc. and the Points representation.
This works really well with opacity mapping and sliding the Mapping Data
curve to highlight the different regions inside the grid.
The main problem is the large size (hundreds of MB) of the CSV files.
Since the grid is rectilinear and equidistant, verbose x,y,z columns are
wasteful.
Writing into a legacy VTK file with STRUCTURED_POINTS yields a nice 7x
size reduction, but then in ParaView the inner points are not displayed.
I've tried using the Glyph representation, which makes the rendering
unusably slow (10+ seconds for a small rotation).
2D Glyphs with Glyph Type Vertex are not noticeably faster and lose
coloring.
Applying the Shrink filter (random googled hint) freezes the GUI for
more than 5 minutes before I kill it. At smaller system sizes the
performance is bad.
For the CSV->TableToPoints described initially, the resulting data
structure is shown in the Information tab as a Polygonal Mesh with 1
single cell and 15 million points, Memory: 600 MB. After loading it
responds and rotates snappily on a recent Core i7 & NVidia GPU.
The VTK file loads with several million cells as well as 15 million
points, and a Image (Uniform Rectilinear Grid) type. Memory: 15 MB ...
much lower but irrelevant with 16 GB RAM.
It appears what I want is to have all points in one single cell, and the
CSV reader is the only one I've found doing the right thing.
Using RECTILINEAR_GRID and custom CELL_DATA in the VTK file doesn't
help: the format apparently doesn't allow to specify less than 1 cell
per 8 vertices (or 4 in 2D).
Next I've tried to use a raw format, but after setting it up, ParaView
insists on creating millions of cells. Same experience as with VTK.
I've also tried ExtractSurface to at least get a Polygonal Mesh from the
Rectilinear Grid: still too slow and too many cells.
Something like a "GridToTable" filter with a subsequent TableToPoints
would do the job, but I can't find such a function. Or a routine to
merge all cells into one.
Creating a custom filter via GUI doesn't work because the loaded
data.vtk "does not have any inputs".
How do I achieve the same performance and display of inner points as
CSV->TableToPoints with either another file format or from the Grid data
structure offered by the VTK file reader?
cheers
Donjan
PS: googling for
paraview grid "to table"
mainly yields results for a typo in the documentation of
TableToStructuredGrid, saying "Converts to table to structured....".
More information about the ParaView
mailing list