CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   Generating vtu and pvtu files (https://www.cfd-online.com/Forums/paraview/124844-generating-vtu-pvtu-files.html)

tylergug October 14, 2013 12:36

Generating vtu and pvtu files
 
Hello,

I am new to this forum and paraview as well. I have some large vtk files that need to be processed, and to process them in parallel I believe that I would need to split them up into multiple vtu files. Then have a pvtu file combine them into a single object. However, I do not know how to split these vtk files into vtu and so on. Does anyone have any experience in this? Any help and information would be greatly appreciated.

Thanks in advance,
Tyler

tylergug October 16, 2013 11:28

Anybody? I haven't been able to find much information on the web about this

whumber October 17, 2013 12:02

Easiest way would probably to just partition them with something like metis or scotch and then convert each partition to its own .vtu file.

yosuke1984 March 11, 2014 14:03

Re Generating vtu and pvtu files
 
This is my pvtu and tria vtu samples.

Basically, a pvtu file is a parent. It calls material1.vtu and material2.vtu files.
If you read the pvtu file, paraview automatically read all the sub domain vtu files.

From your problem size, I believe your problem is domain decomposed. If not use graph partitioners like metis, scotch or chaco. Then it is easy to created each vtu files. Just assign each domain mesh and variables for a vtu files.

Then modify followings according to the number of domains.
Code:

<Piece Source="material1.vtu"/>
<Piece Source="material2.vtu"/>
.
.
.
<Piece Source="materialN.vtu"/>

------------------------------------------------------------------------------------------------------------------------------
parallel.pvtu
------------------------------------------------------------------------------------------------------------------------------
Code:

<?xml version="1.0"?>

<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
<PUnstructuredGrid GhostLevel="0">
<PPoints>
  <PDataArray type="Float32" Name="Position" NumberOfComponents="3"/>
</PPoints>
<PCells>
  <PDataArray type="Int32" Name="connectivity" NumberOfComponents="1"/>
  <PDataArray type="Int32" Name="offsets"      NumberOfComponents="1"/>
  <PDataArray type="UInt8" Name="types"        NumberOfComponents="1"/>
</PCells>
<PCellData Scalars="Material">
    <PDataArray type="Int32" Name="Material" NumberOfComponents="1"/>   
</PCellData>
<Piece Source="material1.vtu"/>
<Piece Source="material2.vtu"/>
</PUnstructuredGrid>
</VTKFile>

------------------------------------------------------------------------------------------------------------------------------
material1.vtu
------------------------------------------------------------------------------------------------------------------------------
Code:

<?xml version="1.0"?>

<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfPoints="3" NumberOfCells="1">
<Points>
  <DataArray type="Float32" Name="Position" NumberOfComponents="3" format="ascii">
    0.0    0.0    0.0
    1.0    1.0    0.0
    0.0    1.0    0.0
  </DataArray>
</Points>
<Cells>
  <DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii">
    0    1    2       
  </DataArray>
  <DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="ascii">
    3   
  </DataArray>
  <DataArray type="UInt8"  Name="types" NumberOfComponents="1" format="ascii">
    5
  </DataArray>
</Cells>
<CellData Scalars="Material">
  <DataArray type="Int32" Name="Material" NumberOfComponents="1" format="ascii">
    1   
  </DataArray>
</CellData>
</Piece>
</UnstructuredGrid>
</VTKFile>

------------------------------------------------------------------------------------------------------------------------------
material2.vtu
------------------------------------------------------------------------------------------------------------------------------
Code:

<?xml version="1.0"?>

<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfPoints="3" NumberOfCells="1">
<Points>
  <DataArray type="Float32" Name="Position" NumberOfComponents="3" format="ascii">
    0.0    0    0
    1.0    0.0    0
    1.0    1.0    0
  </DataArray>
</Points>
<Cells>
  <DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="ascii">
    0    1    2   
  </DataArray>
  <DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="ascii">
    3
  </DataArray>
  <DataArray type="UInt8"  Name="types" NumberOfComponents="1" format="ascii">
    5
  </DataArray>
</Cells>
<CellData Scalars="Material">
  <DataArray type="Int32" Name="Material" NumberOfComponents="1" format="ascii">
    2   
  </DataArray>
</CellData>
</Piece>
</UnstructuredGrid>
</VTKFile>



All times are GMT -4. The time now is 04:44.