北京理工大学 | 李明健
VTU 是 VTK 中的非结构网格,需要储存的变量包括节点坐标(Points)、单元与节点的隶属关系(connectivity)、节点数偏移(offsets)、单元类型(types)、节点上储存的标量、矢量(PointData)、单元上储存的标量、矢量(CellData)。
x1<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
2 <UnstructuredGrid>
3 <Piece NumberOfPoints="321" NumberOfCells="176">
4 <Points>
5 <DataArray type="Float64" Name="Points" NumberOfComponents="3" format="ascii" >
6 0 0.05 0.9 0 0.05 0.9 ...
7 </DataArray>
8 </Points>
9 <Cells>
10 <DataArray type="Int64" Name="connectivity" format="ascii" >
11 167 231 112 161 172 232
12 127 162 172 232 127 162
13 173 31 156 160 ...
14 </DataArray>
15 <DataArray type="Int64" Name="offsets" format="ascii" >
16 8 16 ...
17 </DataArray>
18 <DataArray type="UInt8" Name="types" format="ascii" >
19 12 12 ...
20 </DataArray>
21 </Cells>
22 <PointData Scalars="nodetemperature" Vectors="nodevelocity">
23 <DataArray type="Float64" Name="nodetemperature" format="ascii" >
24 2.9045 3.00478 3.0961 3.164 ...
25 </DataArray>
26 <DataArray type="Float64" Name="nodevelocity" NumberOfComponents="3" format="ascii" >
27 0 0.05 0.93 0 0.056 0.96...
28 </DataArray>
29 </PointData>
30 <CellData Scalars="celltemperature" Vectors="cellvelocity">
31 <DataArray type="Float64" Name="celltemperature" format="ascii" >
32 3 2 ...
33 </DataArray>
34 <DataArray type="Float64" Name="cellvelocity" NumberOfComponents="3" format="ascii" >
35 1.28 1.11 1.32 1.22 1.41 1.15 ...
36 </DataArray>
37 </CellData>
38 </Piece>
39 </UnstructuredGrid>
40</VTKFile>
41
以上是ASCII码形式的文件,可读性强,一个完整的 VTU 文件可参考 example.vtu (点击下载)。
实际为节省存储空间,通常采用压缩方式储存,上述文件的压缩格式为 example_compress.vtu (点击下载),形式如下。
xxxxxxxxxx
1<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
2 <UnstructuredGrid>
3 <Piece NumberOfPoints="321" NumberOfCells="176">
4 <PointData Scalars="nodetemperature" Vectors="nodevelocity">
5 <DataArray type="Float64" Name="nodetemperature" format="binary" >
6 CAoAAAAAA...
7 </DataArray>
8 <DataArray type="Float64" Name="nodevelocity" NumberOfComponents="3" format="binary" >
9 GB4AAAAA...
10 </DataArray>
11 </PointData>
12 <CellData Scalars="celltemperature" Vectors="cellvelocity">
13 <DataArray type="Float64" Name="celltemperature" format="binary" >
14 gAUAAAA...
15 </DataArray>
16 <DataArray type="Float64" Name="cellvelocity" NumberOfComponents="3" format="binary" >
17 gBAAAAA...
18 </DataArray>
19 </CellData>
20 <Points>
21 <DataArray type="Float64" Name="Points" NumberOfComponents="3" format="binary" >
22 GB4AAAAAAAAA...
23 </DataArray>
24 </Points>
25 <Cells>
26 <DataArray type="Int64" Name="connectivity" format="binary" >
27 ACwAAAAAAACnAAA...
28 </DataArray>
29 <DataArray type="UInt8" Name="types" format="binary" >
30 sAAAAAAA...
31 </DataArray>
32 </Cells>
33 </Piece>
34 </UnstructuredGrid>
35</VTKFile>