[Paraview] Odd behavior of XDMF files with 3DCORECTMesh
Armin Wehrfritz
dkxls23 at gmail.com
Mon Sep 29 12:34:10 EDT 2014
Thanks for your reply!
I'm not quite sure if that is really the problem, but it could be related.
I still think there is something wrong in the XDMF class itself.
I did some quick conversion tests for the the different mesh types using
the example data from vtk.org/VTKData.git <http://vtk.org/VTKData.git>:
VTKData/Data/SampleStructGrid.vtk:
DATASET STRUCTURED_GRID
DIMENSIONS 20 30 40
=> <Topology TopologyType="3DSMesh" Dimensions="40 30 20"/>
VTKData/Data/RectGrid2.vtk:
DATASET RECTILINEAR_GRID
DIMENSIONS 47 33 11
=> <Topology TopologyType="3DRECTMesh" Dimensions="11 33 47"/>
VTKData/Data/matrix.vtk
DATASET STRUCTURED_POINTS
DIMENSIONS 10 5 1
=> <Topology TopologyType="3DCORECTMesh" Dimensions="1 5 10"/>
In all cases, the XDMF class reads and writes the dimensions in the
"wrong" way, i.e. ZYX instead of XYZ. Also the data arrays are
read/written in ZYX order.
The most important part for me to notice was that "ORIGIN_DXDYDZ"
(*CoRectMesh) actually specifies the spacing in ZYX and not as the
name suggests in XYZ.
Whereas the data items in "VXVYVZ" ( *RectMesh) specify the XYZ
data.
In my opinion this is kind of a bit messy, but probably not really a bug.
In my specific case, I have HDF5 files with data-arrays in XYZ order,
i.e. z is
iterated over the fastest, then y, and x is iterated over the slowest.
After some trial and error I managed to create a valid .xmf file and read
my data correctly into paraview, though the coordinate axes are still kind
of wrong (ZYX instead of XYZ).
Important to notice here was that the "Dimensions" in the Topology section
need to match the data-structure in the HDF5 file.
Thanks for your help!
-Armin
On 09/25/2014 01:00 AM, David E DeMarle wrote:
> I think this is a very very old bug.
>
> For some reason, *RECTMesh (vtkRectilinearGrid) has been ijk instead of
> kji for as long as I can remember.
>
> *SMesh (vtkStructuredGrid) and *CoRectMesh (vtkImageData) are normal on
> the other hand.
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909 <tel:518-881-4909>
>
> On Sat, Sep 20, 2014 at 7:38 AM, Armin Wehrfritz <dkxls23 at gmail.com
<mailto:dkxls23 at gmail.com>
> <mailto:dkxls23 at gmail.com <mailto:dkxls23 at gmail.com>>> wrote:
>
> Hi,
>
> I lately started to write my data in HDF5/XDMF files. This works
so far
> very well for unstructured data using TopologyType="Mixed" and
Polygon
> cells, but I have some trouble with structured grids.
>
> I attached a very simple VTK file, which is correctly visualized in
> ParaView. More precisely, the DIMENSIONS keyword specifies the
> dimensions in X Y Z direction and the SPACING and POINT_DATA keywords
> are specified accordingly.
>
> Opening the VTK file in ParaView and exporting the data as XDMF
leads to
> an XDMF file with dimensions and the spacing is in reverse order (Z Y
> X), where seemingly the data is written in the same order as in
the VTK
> file.
> Is this intended or a bug?
> Just to note, the data from the ParaView-created XDMF and the
original
> VTK file are displayed consistently.
>
> When I however manually converter the VTK to a XDMF file with
> dimensions, spacing and data specified as in the VTK file, I get a
> completely wrong representation in ParaView.
> Seemingly, in the "Topology" element the "Dimensions" keyword
specifies
> the dimensions in Z Y X direction, which I thing is rather odd.
> The whole thing gets then completely messed up when specifying
the data.
>
> Am I doing something wrong when manually creating the XDMF file or is
> this a bug?
>
> Best regards,
> Armin
>
>
>
> --
> Armin Wehrfritz, Dipl.-Ing. (M.Sc.)
> Aalto University, School of Engineering
> Department of Energy Technology
> PO Box 14300
> FI-00076 Aalto, Finland
>
> _______________________________________________
> Powered by www.kitware.com <http://www.kitware.com>
<http://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://public.kitware.com/mailman/listinfo/paraview
>
>
More information about the ParaView
mailing list