blueCFD / lagrangianExtraFunctionObjects

Function object library re-adapted from OpenFOAM 5, to write to disk in the old positions file format.
GNU General Public License v3.0
19 stars 3 forks source link

write both ascii and binary formart #4

Closed ZmengXu closed 2 years ago

ZmengXu commented 4 years ago

Dear author,

I am ZmengXu, I have made a little bit change to your code to make it compatible for a binary format data.

In most of the big cases, OpenFOAM data is written as a binary format. However, the current utility only writes the ASCII position, thus we have a compatible issue for the binary format.

I wrote a judgment, as suggested in OpenFOAM-1806, to make it compatible for both ASCII and binary formats. I have tested in both OF6 and OF7, it works fine. Please see the code difference in the pull request.

By the way, the ParaView-OpenFOAM-binary reader module only recognizes the 'Int32' version OpenFOAM data, which is a common issue for ParaView. Therefore, for the 'Int64' OpenFOAM binary data, the only solution is to use paraFoam instead of ParaView, since paraFoam know the size of "label" is 32bit or 64bit, but ParaView doesn't know.

ZmengXu Department of Energy Sciences Lund University, 22100 Lund, Sweden. Email:shijiexu2010@gmail.com

wyldckat commented 2 years ago

@ZmengXu Many thanks for your merge request, this also closes Issue #5. I only finally managed to look into this today, when I tripped over the same issue myself.

I'll be making a few more commits after this one, to do some tweaking.