我有一个向量字段,可以使用以下xdmf文件加载和显示(例如在paraview中):
<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf Version="2.0">
<Domain>
<Grid Name="staggered_east" GridType="Uniform">
<Topology TopologyType="3DRectMesh" NumberOfElements="34 34 34"/>
<Geometry GeometryType="VXVYVZ">
<DataItem Dimensions="34" NumberType="Float" Precision="4" Format="XML">
0.0000000000000000 0.10000000000000001 0.20000000000000001 0.30000000000000004 0.40000000000000002 0.50000000000000000 0.60000000000000020 0.70000000000000007 0.80000000000000004 0.90000000000000002 1.0000000000000000 1.1000000000000001 1.2000000000000002 1.3000000000000000 1.4000000000000001 1.5000000000000000 1.6000000000000001 1.7000000000000002 1.8000000000000000 1.9000000000000001 2.0000000000000000 2.1000000000000001 2.2000000000000002 2.3000000000000003 2.4000000000000004 2.5000000000000000 2.6000000000000001 2.7000000000000002 2.8000000000000003 2.9000000000000004 3.0000000000000000 3.1000000000000001 3.2000000000000002 3.3000000000000003
</DataItem>
<DataItem Dimensions="34" NumberType="Float" Precision="4" Format="XML">
-5.0000000000000003E-002 5.0000000000000003E-002 0.15000000000000002 0.25000000000000000 0.35000000000000003 0.45000000000000001 0.55000000000000004 0.65000000000000013 0.75000000000000000 0.85000000000000009 0.94999999999999996 1.0500000000000000 1.1500000000000001 1.2500000000000000 1.3500000000000001 1.4500000000000002 1.5500000000000000 1.6500000000000001 1.7500000000000000 1.8500000000000001 1.9500000000000002 2.0499999999999998 2.1500000000000004 2.2500000000000000 2.3500000000000005 2.4500000000000002 2.5499999999999998 2.6500000000000004 2.7500000000000000 2.8500000000000005 2.9500000000000002 3.0499999999999998 3.1500000000000004 3.2500000000000000
</DataItem>
<DataItem Dimensions="34" NumberType="Float" Precision="4" Format="XML">
-5.0000000000000003E-002 5.0000000000000003E-002 0.15000000000000002 0.25000000000000000 0.35000000000000003 0.45000000000000001 0.55000000000000004 0.65000000000000013 0.75000000000000000 0.85000000000000009 0.94999999999999996 1.0500000000000000 1.1500000000000001 1.2500000000000000 1.3500000000000001 1.4500000000000002 1.5500000000000000 1.6500000000000001 1.7500000000000000 1.8500000000000001 1.9500000000000002 2.0499999999999998 2.1500000000000004 2.2500000000000000 2.3500000000000005 2.4500000000000002 2.5499999999999998 2.6500000000000004 2.7500000000000000 2.8500000000000005 2.9500000000000002 3.0499999999999998 3.1500000000000004 3.2500000000000000
</DataItem>
</Geometry>
<Attribute Name="u" AttributeType="Scalar" Center="Node">
<DataItem ItemType="Uniform"
Name="uvw"
Format="Binary"
Dimensions="34 34 34 3"
DataType="Float" Precision="8" Endian="Big" Seek="8"
>
uvw_000001.bin
</DataItem>
</Attribute>
</Grid>
</Domain>
</Xdmf>
这很好用,但是我真正想做的是:
(从长远来看,我实际上打算将向量uvw(i,j,k)[m]
的每个分量uvw(i,j,k)
关联到一个单独的网格。)
我尝试使用参考:
<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf Version="2.0">
<DataItem ItemType="Uniform"
Name="uvw"
Format="Binary"
Dimensions="34 34 34 3"
DataType="Float" Precision="8" Endian="Big" Seek="8"
>
uvw_000001.bin
</DataItem>
<Domain>
<Grid Name="staggered_east" GridType="Uniform">
<Topology TopologyType="3DRectMesh" NumberOfElements="34 34 34"/>
<Geometry GeometryType="VXVYVZ"> ... </Geometry>
<Attribute Name="u" AttributeType="Scalar" Center="Node">
<DataItem ItemType="Uniform"
Format="XML"
Name="u"
Dimensions="34 34 34 3">
<DataItem Reference="XML" >
/Xdmf/DataItem[@Name="uvw"]
</DataItem>
</DataItem>
</Attribute>
</Grid>
</Domain>
</Xdmf>
和一个函数
<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf Version="2.0">
<DataItem ItemType="Uniform"
Name="uvw"
Format="Binary"
Dimensions="34 34 34 3"
DataType="Float" Precision="8" Endian="Big" Seek="8"
>
uvw_000001.bin
</DataItem>
<Domain>
<Grid Name="staggered_east" GridType="Uniform">
<Topology TopologyType="3DRectMesh" NumberOfElements="34 34 34"/>
<Geometry GeometryType="VXVYVZ"> ... </Geometry>
<Attribute Name="u" AttributeType="Scalar" Center="Node">
<DataItem Name="MyFunction"
ItemType="Function"
Function="$0">
<DataItem Reference="/Xdmf/DataItem[1]" />
</DataItem>
</Attribute>
</Grid>
</Domain>
</Xdmf>
但两种方法均无效。
即paraview崩溃时说:
paraview --mesa
'Format' not found in generateHeavyControllers in XdmfCoreItemFactory
terminate called after throwing an instance of 'XdmfError'
what(): 'Format' not found in generateHeavyControllers in XdmfCoreItemFactory
fish: “paraview --mesa” terminated by signal SIGABRT (Abort)