CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ParaView

Generating vtu and pvtu files

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By yosuke1984

Reply
 
LinkBack Thread Tools Display Modes
Old   October 14, 2013, 12:36
Default Generating vtu and pvtu files
  #1
New Member
 
Join Date: Oct 2013
Posts: 3
Rep Power: 3
tylergug is on a distinguished road
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 is offline   Reply With Quote

Old   October 16, 2013, 11:28
Default
  #2
New Member
 
Join Date: Oct 2013
Posts: 3
Rep Power: 3
tylergug is on a distinguished road
Anybody? I haven't been able to find much information on the web about this
tylergug is offline   Reply With Quote

Old   October 17, 2013, 12:02
Default
  #3
New Member
 
William Humber
Join Date: Nov 2009
Posts: 11
Rep Power: 7
whumber is on a distinguished road
Easiest way would probably to just partition them with something like metis or scotch and then convert each partition to its own .vtu file.
whumber is offline   Reply With Quote

Old   March 11, 2014, 14:03
Default Re Generating vtu and pvtu files
  #4
New Member
 
yosuke
Join Date: Aug 2011
Posts: 5
Rep Power: 0
yosuke1984 is on a distinguished road
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>
wyldckat likes this.

Last edited by wyldckat; March 15, 2014 at 06:26. Reason: Added [CODE][/CODE]
yosuke1984 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:36.