Making a file for Paraview from FEM data

Hello everyone. I have searched too much on the internet about making a file for Paraview from my finite element data. Most explanations available on the internet are useless and just waste our time.

I often use Tecplot to provide the figures for my papers. In what follows, I simply explain how I make a “text file” for Tecplot. I need someone who teach me how to convert my “text file” so that it can be used in Paraview (I have no time to learn Python or so on. I just need an UNDERSTANDABLE SAMPLE FILE).

Let us consider two adjacent quadrilateral finite elements over a 2*1 rectangular domain (6 nodes, 2 elements). Assume that pressure and temperature of the nodes have bee obtained by the FE code. What have been written in the following lines can be save as a “.text” file and used in Tecplot.

For TECPLOT (not for Paraview):

TITLE = “A simple FEM data file for Tecplot”
VARIABLES =“x”,“y”,“tempretaure”,“pressure”
N=6, E=2, F=FEPOINT, ET=Quadrilateral
0 0 1.2 2.6
0 1 2.3 1.8
0 2 12.1 3.2
1 0 9.5 4.1
1 1 4.1 5.6
1 2 8.3 6.3

1 2 4 5
2 3 5 6

Thats it! The above-written 11 lines can be saved as a “.tex” file and then used in Tecplot.

N=6=is the number of nodes
E=2=is the number of elements (in Quadrilateral form)
We see two matrices as the basic data. The first matrix is 6*4 that provides the data of NODES. The line (VARIABLES =“x”, “y”, “tempretaure”, “pressure”) clarifies that the 1st column is the x-coordinate, 2nd column is y-coordinate, 3rd column is temperature, and the 4th column is pressure.

The second matrix is 2*4 and is indeed the “connectivity matrix”. The first row “1 2 4 5” shows that the first element is constructed by connecting these nodes, and the same holds for the 2nd element made by the nodes “2 3 5 6”.

Now, could you please help me to transform my extremely simple data file to something that can be used in Paraview? (I just know that I have to start the numbering of nodes from “0” instead of “1”!)

If you rewrite it as attached, you can read it using ParaView’s Tecplot Reader.

test.tec (257 Bytes)

Hello, @Arash!
Perhaps this discussion will be useful in terms of creating text (non-binary) files of legacy VTK format:

Thank you so much dear Kyoshimi.
The method you advised works!

Now, I have one more question abot “SAVING IN PARAVIEW”:

In Tecplot, I can read the “.txt” file and add some legends/ explanations/ determine the thickness and color of meshes/ and so on to make a professional figure to be used in a research paper. I can save my file in Tecplot in “lpk” format. Once I open that “lpk” file via Tecplot, I see what I have done (the figure that I have spent time to make it). I then “export” it as an EPS file to be used in LATEX.

In summary, I do the followings:
Run my FEM code in e.g., MATLAB ==> Make a text file for TECPLOT as a part of my FE code==> open the text file in Tecplot and make a “.lpk” file & export it as an EPS file to be used in LATEX ==> submit the LATEX file to journals

Now, how can I save my file in Paraview? I observed that there are several options to save a file in Paraview. However, it seems that none of them plays the role of a “lpk” file in Tecplot.

I would be grateful if someone answer my question.

Perhaps the corresponding “lpk” format file in Tecplot is the State file (*.pvsm or *.py) in ParaView. The menus for saving and loading State file, respectively, are located at:

  • File > Save State…
  • File > Load State…

Thanks so much Kyoshimi. You are excellent. You helped me so much by answering my two main questions.

Do you know anything about increasing the quality of the output files of Paraview?
Now, my only problem with Paraview is the low quality of its output EPS (and other format) files.