Bug in Save Data (Ctrl+S) ?

Hello All,
If after you have successfully plotted in Paraview the results loaded from VTK or Silo files you then try to save the data using “File/Save Data …Ctrl+S” in regular ASCII TXT/CSV file format you get all the variables which were present in VTK/Silo files saved correctly in the saved table but the coordinates XYZ of the data points, nodes or cells are completely missing no matter what other existing few options to save you try making the output totally useless.

Am i doing something wrong with the “Save Data”? By the way same story but opposite - coordinates are there but not a single variable is saved - is with the Visit plotting program

Hi @DanRR , and welcome !

This is expected, .csv format does not support this kind of information. Just use another format.

Best,

Interesting. So with VTK you can create the image of say your face but you can not get back and can not read the RGB color of each pixel of your image and place it into usual text format???

Depends on what you call “usual text format”.
There are some ASCII file format supported in VTK, including the native .vtX family.

But CSV has limitations, including not mixing Point Data and Cell Data in the same file.

Text/binary format like in Fortran. File opened by any text editor without any tags

Text/binary format like in Fortran. File opened by any text editor without any tags

Thats not a format. CSV do not support what you want, many other format do.

Then why your Ctrl+S doing output of Y values without appropriate Xes into txt file ? Looks like somebody did not know what he was doing ? :))

There is no reason not to support simplest ASCII txt format. You can ask user if he wants the saved data cell centered or node/interface centered. That is how most of variables data in the PIC or Hydro codes defined and used. What, is this hard to do that? :))))))

By the way the main reason why all these 100s of barely used formats were invented and used was because of incompatibility of binary files from compiler to compiler and from OS to OS. Recently though all compilers finally got the ability to be fully compatible on binary output level (as simple as by just using access=STREAM when you open the file) so the big need in all these formats is gone. And just the simple binary outputs are way faster than with all these “formats” which will now go into oblivion

VTK is open source and your contributions are welcome: https://gitlab.kitware.com/vtk/vtk/

BTW using text based format is highly ineficient.

Hahaha ParaView people send you to VTK - the VTK people send you to ParaView and VisIt. :)))))))

Sure, TXT files are slow and large but they are extremely useful for debugging. After debugging done, the best way is avoiding all these “formats” and use binary output which has speeds ~8GB/s and the size barely compressible more

All ParaView people are VTK people, @DanRR .

If you want to improve the vtkDelimitedTextReader, the class is here: https://gitlab.kitware.com/vtk/vtk/-/blob/master/IO/Infovis/vtkDelimitedTextReader.cxx

I agree that it needs improvement tbh and your idea of a new feature is actually not bad, writing cell data can make sens in some cases.

Whoa. Hang on a second. Are you saying you wrote out a csv/txt file that had the x coordinates but not the y (or z) coordinates? I have never seen that, and that sounds like a bug. Can you provide an example where the x coordinates are written but not the y values?

I am confused. ParaView does exactly this. When you ask ParaView to write out a csv/txt file, it gives you a dialog where one of the options is a combo box to choose whether to write out cell centered or node (point) centered data.

Screen Shot 2022-08-30 at 6.52.32 AM

Is this not working for you?

1 Like

Liitle bit not that. ParaView outputs all the variable values seems ok but does not a single their coordinate.
And yes, this pop menu with cell centered/node point centered options does not work. You always get cell/node values in the output OK but the coordinates are absent. It generates just one line with the name ) options all give something incomprehensive (and very different - either Y, just one line, or nothing) without explanation why. And the Point option does not give you anything at all. I can send you the VTU/Silo files, they all plot nicely but Ctrl+S fails on all options as if it was not tested at all

Great that you guys quickly respond. Hope all will be quickly fixed ! Will be glad to test

Again, I am confused. Everything you say seems to be working for me.

Maybe the one thing you are expecting to work but does not is that if you write out cell data to a csv file, you will not get any point coordinates (at the center or any place else in the mesh). This is by design as the csv writer writes out the data that exists on the data set; no more, no less. The coordinates of the cell center are not in the data, so they are not written out.

However, you can easily get the cell centers written to a csv file by creating a cell field that contains the cell centers before writing out the data. Unfortunately, ParaView does not come with a filter to directly compute the cell centers (c.f. Add the cell center coordinates to the cell data), but here is a custom custom filter that will add an Append Cell Centers filter that will do just that:

AppendCellCenters.cpd (5.2 KB)

To load this, go to ToolsManage Custom Filters... . Then click the Import button to load this file. The new filter will appear in the filters list.

Just succeeded to use this filter and from the first glance i immediately see the difference, the output looks reasonable. Many thanks to Kenneth and all who discussed this issue and tried to help.

Great. Glad that works.

It was just pointed out to me that ParaView now comes with an Append Location Attributes filter that will also create the cell centers. That’s an easier way to do it than loading a custom filter.

Thanks. Cool that output of data got some improvements from the developers.

Additional suggestion to them would be to add these relevant filters directly into into the dialog dropbox you have shown above. And the word Filters is a bit confusion. Because some do interpolation, some do transformation etc of data . But the word Filters, and also placed far from the necessity into the main Menu does not encourage users to try them for saving data