问题
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.
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/21294186/converting-a-3d-array-in-ascii-to-a-file-paraview-can-read