Import data to Paraview

Hello,
I would like to plot the result of a stress analysis of a finite element made of 4 corner plate model loaded with some forces.

After the analysis I have tables defining my model and results in text fomat. One table with node id, X, Y, Z (4 columns).
Another table with plate id and the four nodes connected (5 columns).
Another table with plate id and data (2 columns).
Another table with node id and data (2 columns).

My final goal is to be able to show the plates and to plot a colormap with data defined at points. But also in case of data defined at plates, in which case it would be in each plate center.

I would like to know if the best strategy is to import data into paraview, for example as csv or if it is better to first convert it to vtk with vtk converter library for python, and then import to Paraview.

I tried both and I am struggling to find the right commands, so I am still far from success. But at least, as a first step, I would like to know if direct import into Paraview is recommended.

Any help is appreciated

Thank you

I would like to know if the best strategy is to import data into paraview, for example as csv

That sounds like the right plan

Please share your data.

Hello Mathieu,
Thank you for your help.

Find an example of my data.
It is a plate supported by vertical springs (soil).

At the moment I am just trying to see the internal forces from a top view.
I’d love to keep the ids as they are, since I can then show them in Paraview.
If I am not mistaken, the vtk standard does not use ids of points and cells, but it just uses the place that they occupy in the list as id.
In my case some numbers are missing, I jump from one number to another because it is convenient for compatibility of other calculations that i am doing with another spreadsheet.

My objective is to make it authomatic, so I guess I should code it in Python, but in this first stage just want to get familiar with Paraview and using the GUI is fine.

Thank you again.

Giorgio

Paraview data.rar (57.4 KB)

This might help you.

I agree with @todoooo , you need to recreate the data structure using the individual tables in your .csv, to do that a ProgrammableFilter is needed.

Hello Mathieu and @todoooo,

I have imported points plus an id. Separately, I have imported cells plus an id. Cells are defined in 3 different csv files depending if they are quads, tringles or frames.

I managed to create the join everything with a programmable filter and to include in the definitions of each element the original id, because now I need to add data, and data is referenced to the original ids.

The first thing I would like to ask you is if the way I imported the data is correct. I don’t want to use a strategy more complicated than needed. (pvsm attached)
Second, I now need to import data (it can be to nodes or to cells). What is the best way to do it? Again I want to make it as simple as possible. I am sure I can do it with a programmable filter, but if there is a simple way with a built in filter let me know. FInd attached a csv file for cells (for example the plate thickness) or for points (for example point reactions). The difficulty here is that everything is always referenced to the original ids, not the ones automatically assigned by paraview during the import.

Thank you

cell_thickness.csv (23.1 KB)
point_efforts.csv (50.3 KB)
PV_file.pvsm (304.4 KB)

I’m afraid not, unless you change the way the data is exported, you need to reconstruct your mesh using a prog filter.

Hello Mathieu,

Understood. Do you have in mind an alternative approach? One possibility may be to redefine all ids (points and cells) in a sequential way so that it is similar to vtk format. Importing everything will be easier. After that I can just append the original ids to points and cells. (Will I be able to show these ids with labels?)

Let me know your thoughts.

Thank you

Giorgio

You either should export to an existing format for which ParaView already has a reader for (eg: .vtk, .vtp., .vtkhdf …) or you have to write your own reader/logic in a prog filter.

There are some ways to create dataset from .csv (TableToPoints, TableToStructuredGrid) but what you describe is too complex.

Ok, thank you for your help.
Regards
Giorgio

@giofed Are you using a commercial FE solver with a standard output format?

Hello Todd,

The model mesh, loads, materials, etc. are parametrically generated in Excel and formatted to be inputed in Openseespy language. So the output can be built more or less freely and I decided to write individual csv files for simplicity. I thought csv might work, but apparently it is hard to keep track ids of points and cells when imported into Paraview.

I also have a script to convert csv individual files to usable vtk format. But again, I lose the ids.
Let me know if you have any suggestion.

Best Regards

Giorgio

If you’re generating the output yourself then there are quite a few options.

The easiest route is the legacy VTK format, but the most robust, future-proof, route is probably VTKHDF as suggested by @mwestphal

1 Like