3

I am trying to get a data file of mine converted to something that Paraview can read. What I have found so far is that it needs to be converted to a VTK but I am not sure how to begin this. I have seen a bunch of answers but nothing relating to what I need. Here is what I have... I have a .dat file with 4 columns of numbers.

x- coordinate, y- coordinate, z- coordinate, density at that point

The code I am using is in Fortran. Can someone please point me in the right direction. Can Fortran output the file itself or what can I use to convert it. Thank you.

Ali_Sh
  • 2,667
  • 3
  • 43
  • 66
user3225302
  • 31
  • 1
  • 2
  • Fortran can write VTK data files itself, if you want to get the new VTK format using XML, you however need to do a base64 encoding, which is probably best done in C. Via the ISO-C-Binding you can also call VTK itself from Fortran. This might give you an idea: http://szaghi.github.io/Lib_VTK_IO/index.html – haraldkl Jan 23 '14 at 00:11
  • I guess you know the VTK file format description http://www.vtk.org/VTK/img/file-formats.pdf? – Jakob Jan 24 '14 at 22:19
  • Do you want to plot these data as a structured grid or just import them in Paraview as arrays (or scatter plot) ? – Remy F Feb 06 '14 at 13:13

2 Answers2

2

Paraview supports a bunch of different file formats. Paraview reads those different file formats using so called readers. You can get a list of support file formats/readers here:

Paraview list of readers

The first one in the list (AVS UCD) is pretty simple to use. The following webpage indicates the format used to construct a file for this reader:

UCD format

As indicated there, all you have to do is enter your point coordinates, then list your cells (which for you are simply points), and finally for each point enter the corresponding vector data.

user3208430
  • 636
  • 1
  • 6
  • 14
1

Your .dat file is a .csv file.

Rename it to .csv and open it with ParaView, then apply a TableToPoints or TableToStructuredGrid filter on it.

Ali_Sh
  • 2,667
  • 3
  • 43
  • 66
Mathieu Westphal
  • 2,544
  • 1
  • 19
  • 33