XDMF-使用Hyperslab从向量字段中提取组件

时间:2018-08-07 08:39:33

标签: xml paraview

我正在尝试加载存储在文件uvw_000001.bin中的向量字段的单个分量。

我正在使用XDMF文件,该文件将字段值很好地加载到变量q中,即可以在Paraview中查看其组件。

我试图提取向量字段的第一部分的第二个变量u在Paraview中不可用。

我在做什么错了?

<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>

<Xdmf Version="3.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="q" AttributeType="Scalar" Center="Node">

        <DataItem 
          ItemType="Uniform"
          Name="uvw_s"
          Format="Binary"
          Dimensions="34 34 34 3"
          DataType="Float" Precision="8" Endian="Big" Seek="8"
          >
          uvw_000001.bin
        </DataItem>

      </Attribute>


      <Attribute Name="u" AttributeType="Scalar" Center="Node">

        <DataItem 
          ItemType="HyperSlab"
          Dimensions="34 34 34"
          Type="HyperSlab">

          <DataItem
            Dimensions="3 4"
            Format="XML">
            0   0  0  0
            1   1  1  1
            34 34 34  1
          </DataItem>

          <DataItem 
            ItemType="Uniform"
            Name="uvw"
            Format="Binary"
            Dimensions="34 34 34 3"
            DataType="Float" Precision="8" Endian="Big" Seek="8"
            >
            uvw_000001.bin
          </DataItem>

        </DataItem>

      </Attribute>


    </Grid>

  </Domain>

</Xdmf>

更新 我现在意识到,使用Paraview的xdmf阅读器而不是xdmf3时,代码实际上可以工作。后者是默认设置。

是否可以使用xdmf3阅读器获得相同的结果?

0 个答案:

没有答案