User Forum of Software BASEMENT

BASEMENT
Basic Simulation Environment for computation of environmental flow and natural hazard simulation
Laboratory of Hydraulics, Hydrology and Glaciology (VAW)
ETH Zurich
Basement_Logo

You are not logged in.

#1 2025-11-04 14:25:27

Matteo Facchini
Developer
From: Trento
Registered: 2014-09-05
Posts: 297

XDMF precision for ParaView

Dear all
I just found out that, if not specified, ParaView reads the coordinates given via xdmf/h5 with precision=1.
This leads to visualization errors if one uses a generic reference system, and the coordinates are represented by large numbers (see this topic for reference, even though it refers to vtk files, not to xdmf).

To solve this, it's enough to add Precision="8" (which is the same solution as suggested in the topic above, i.e., switching to double precision) to the two lines starting with

<DataItem Format="HDF" Rank="2" 

and referring to "Topology" and "Coordinates",

which would become something lik

<Topology TopologyType="Triangle" NumberOfElements="718883">
	<DataItem Format="HDF" Rank="2" Precision="8" Dimensions="718883 3">results.h5:CellsAll/Topology</DataItem>
</Topology>
<Geometry>
	<DataItem Format="HDF" Rank="2" Precision="8" Dimensions="361555 3">results.h5:NodesAll/Coordnts</DataItem>
</Geometry>

I tested it also with QGIS, this addition does not corrupt the xdmf file, that remains readable in QGIS, too.

Would it be possible to add this correction to the next release?

Cheers
Matteo

Offline

Board footer

Powered by FluxBB