並列VTK形式 (VTU形式)
xml形式のVTUデータは並列用にも出力できます。小さいのを手で書くのは簡単なので作ってみた。
以下に示すように
parallel.pvtu
material1.vtu
material2.vtu
のファイルを同じディレクトリに用意する。 あとはparaviewでparallel.pvtuを開いてあげれば表示できる。
------------------------------------------------------------------------------------------------------------------------------
paralell.pvtu
------------------------------------------------------------------------------------------------------------------------------
<?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
------------------------------------------------------------------------------------------------------------------------------
<?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
------------------------------------------------------------------------------------------------------------------------------
<?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>
こんなのが出るはず。青いのがmateral1で赤いのが2。
0 件のコメント:
コメントを投稿