[Paraview] Problem with Xdmf/HyperSlab

Jens Kleimann jk at tp4.rub.de
Mon Jan 31 04:47:26 EST 2011


Hi Dan,

first off, you are absolutely right about your comment on the Topology syntax: It needs a "NumberOfElements" tag, not "Dimensions". Unfortunately, changing just that does not help.
You are also right in noting that values for all grid points need to be provided, else PV will fill in numerical garbage. But the point is, the _target_ array is deliberately just [0,1]^3 with eight nodes, therefore the dat_01 and dat_02 attributes only need (and in fact do) specify eight values. "dat_hyper" is larger: [0,2]^3 with the same spacing, hence consisting of 3^3=27 values, but I only wish to use its [0,1]^3 subset on the grid (that's what the HyperSlab is supposed to be good for), the rest should never get displayed. In fact, to reproduce the crash, you could as well delete the dat_01 and dat_02 Attributes, they are just for illustrative purposes.

But thanks anyway for your reply.
Jens.

On 29.01.2011 21:17, Dan Lussier wrote:
> Hi Jens,
> 
> I'm not super solid on using the HyperSlab functionality of XDMF but I
> wonder if some of the issue might be about how you're currently
> specifying your grid topology and then mapping the scalar data onto
> the grid.
> 
> Based on the XDMF specs you should have a NumberOfElements attribute
> in your Topology rather than a Dimensions attribute which is used for
> describing the arrangement of underlying data in DataItem tags.
> 
> So for you I think you'll need:
> 
> <Topology TopologyType="3dCoRectMesh" NumberOfElements ="3 3 3"/>
> 
> In combination with your origin and DxDyDz this should give you a mesh
> which goes from [0,2]^3.
> 
> With that same idea in mind for the basic scalar data "dat_01" unless
> you do something nifty with Hyperslabs (or other methods to map data
> across the mesh) I think you need to give data elements for ALL the
> Nodes you have in the underlying mesh.  Therefore, you'll need
> something like
> 
>      <Attribute Name="dat_01" AttributeType="Scalar" Center="Node">
>        <DataItem Dimensions="3 3 3" NumberType="Float" Format="XML">
>             1  2  3
>             4  5  6
>             7  8  9
> 
>             1  2  3
>             4  5  6
>             7  8  9
> 
>             1  2  3
>             4  5  6
>             7  8  9
>        </DataItem>
>      </Attribute>
> 
> Which gives a scalar value to each node in the 27 node [0,2]^3 array.
> In my experience if you don't specify a value for a node the result is
> pretty erratic in PV. F For example when I left out the last layer of
> nodes I got a data range of [0, 1.77323e+28] in PV.
> 
> Sorry I can't be more help with the hyperslabs, maybe someone else
> will be able to help there.
> 
> Dan
> 
> 
> On Wed, Jan 26, 2011 at 5:37 AM, Jens Kleimann <jk at tp4.rub.de> wrote:
>> Hello,
>>
>> either the implementation of the HyperSlab Itemtype, or my grasp of it is corrupted. To illustrate the problem which I am getting, see the attached XDMF file (no HDF5 needed, just plain XML), which is supposed to cut a 2x2x2 cube out of a larger 3x3x3x cube. My issues:
>> 1. To extract the subgrid [0,1]^3 from the larger [0,2]^3 grid, I set the start-stride-count in the first DataItem to
>>  0 0 0
>>  1 1 1
>>  2 2 2
>>  in analogy to the example from [www.xdmf.org/index.php/XDMF_Model_and_Format], but this causes Paraview to crash. ("*** glibc detected *** ... realloc(): invalid next size: 0x0000000008e1a800 ***")
>> The same happens if I try to access the opposite corner [1,2]^3 (the one with values in the [8,15] range) using
>>  1 1 1
>>  1 1 1
>>  2 2 2
>> 2. I can apparently avoid the crash using ranges whose count values are at least 3 (which should obviously be too large for the 2x2x2 target grid), and even grossly out-of-bound values such as
>>  12 11 321
>>  1 1 1
>>  6 13 13
>> are accepted without complaints, and result in something that from visual inspection looks like
>>  1 2 0 3 4 0 0 0
>> i.e. a copy of the beginning of the source array.
>>
>> Can anybody explain to me what is going on here?
>> Any hint would be apprechiated.
>>
>> Best, Jens.
>> PS: I have tried to get help from the Xdmf mailing list (so far without any response), but since this potentialle concerns both [Paraview] and [Xdmf] (and this list is apparently more active), I post this here again.
>>
>>
>> <!-- BEGIN hyperslab_test.xml -->
>> <?xml version="1.0" ?>
>> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
>> <Xdmf Version="2.0">
>>  <Domain>
>>    <Grid Name="myGrid" GridType="Uniform">
>>      <Topology TopologyType="3dCoRectMesh" Dimensions="2 2 2"/>
>>      <Geometry GeometryType="Origin_DxDyDz">
>>        <DataItem Dimensions="3" NumberType="Float" Format="XML">
>>          0.0  0.0  0.0
>>        </DataItem>
>>        <DataItem Dimensions="3" NumberType="Float" Format="XML">
>>          1.0  1.0  1.0
>>        </DataItem>
>>      </Geometry>
>>      <Attribute Name="dat_01" AttributeType="Scalar" Center="Node">
>>        <DataItem Dimensions="2 2 2" NumberType="Float" Format="XML">
>>          1 2 3 4 5 6 7 8        <!-- expected in [0,1]^3 -->
>>        </DataItem>
>>      </Attribute>
>>      <Attribute Name="dat_12" AttributeType="Scalar" Center="Node">
>>        <DataItem Dimensions="2 2 2" NumberType="Float" Format="XML">
>>          8 9 10 11 12 13 14 15  <!-- expected in [1,2]^3 -->
>>        </DataItem>
>>      </Attribute>
>>      <Attribute Name="dat_hyper" AttributeType="Scalar" Center="Node">
>>        <DataItem ItemType="HyperSlab" Dimensions="2 2 2" Type="HyperSlab">
>>          <DataItem Dimensions="3 3" Format="XML">
>>           0 0 0
>>           1 1 1
>>           2 2 2
>>          </DataItem>
>>          <DataItem Dimensions="3 3 3" NumberType="Float" Format="XML">
>>            1 2 0 3  4  0 0  0  0
>>            5 6 0 7  8  9 0 10 11
>>            0 0 0 0 12 13 0 14 15
>>          </DataItem>
>>        </DataItem>
>>      </Attribute>
>>    </Grid>
>>  </Domain>
>> </Xdmf>
>> <!-- END hyperslab_test.xml -->
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview


More information about the ParaView mailing list