Converting a 3D array in ASCII to a file Paraview can read

孤人 提交于 2020-02-22 07:01:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!