View Issue Details

IDProjectCategoryView StatusLast Update
0002197OpenFOAMBugpublic2016-09-03 16:42
Reporterdlonie Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionno change required 
Summary0002197: Detecting element size of binary data
DescriptionThis is a followup to bug #2196 (I tried to add a note to that one, but it didn't seem to allow me to).

The issue with ParaView reading the test case is that our binary reader expects binary data to be encoded as 32-bit floats, but this file is storing the data as 64-bit floats.

A google search turned up this discussion: http://www.cfd-online.com/Forums/openfoam/79655-binary-files.htm which seems to imply that the binary data format is determined by the compilation settings of the writer, and this information is not communicated in the actual data set. Is this correct?

As a general purpose reader, we need some way of knowing what sort of data to expect when reading a file, since we are not tightly coupled with any particular writer. Is there any way of knowing how the data is stored from inspecting metadata?
TagsNo tags attached.

Activities

henry

2016-08-17 16:37

manager   ~0006694

Generally OpenFOAM is compiled with 64bit scalars and 32bit labels although it may be compiled single precision, i.e. 32bit scalars, and there is now an option to compile with 64bit labels for very large cases. When writing binary the data is dumped directly from memory and hence contains the size of data corresponding to the build options of OpenFOAM. Correspondence is guaranteed between the OpenFOAM and the reader module we supply with OpenFOAM by compiling that reader with the same options used for the rest of OpenFOAM and using the same IO code for both. This ensures consistence of all IO options, data structures, memory layout etc.

dlonie

2016-08-17 16:40

reporter   ~0006695

I see. So to confirm, these options are not stored in the data format itself?

In that case, since ParaView does not use the OpenFOAM reader module, I think the best we can do is provide options for a user to specify the data sizes themselves.

henry

2016-08-17 16:50

manager   ~0006696

> So to confirm, these options are not stored in the data format itself?

Correct

> In that case, since ParaView does not use the OpenFOAM reader module, I think the best we can do is provide options for a user to specify the data sizes themselves.

Right

Issue History

Date Modified Username Field Change
2016-08-17 16:19 dlonie New Issue
2016-08-17 16:37 henry Note Added: 0006694
2016-08-17 16:40 dlonie Note Added: 0006695
2016-08-17 16:50 henry Note Added: 0006696
2016-09-03 16:41 henry Status new => closed
2016-09-03 16:42 henry Assigned To => henry
2016-09-03 16:42 henry Resolution open => no change required