Json
I am wondering why doesn't OpenFOAM go with JSON format for its files? That would be easier for other programmers to parse.
|
There is absolutely no rational reason for a tool like OpenFOAM to use JSON, XML or any other text/ASCII/UTF-8 based storage format. This is simply because 99.99999% (approx.) of the data stored as results from a CFD simulation is floating point numbers. Storing this as text is highly inefficient, independent on the format chosen (current format/JSON/XML etc.).
In my opinion, the only sensible choice is to store the data in a binary format. This should be based on commonly available and freely licensed APIs. My suggestions is HDF5 or CGNS, witch are two quite different formats (HDF5 is a general HPC data container, while CGNS is a CFD-specific file format). |
Thanks, It is actually just this (1-99.99999%=0.00001%) files like fvSchemes or fvSolution that are what I am interested in and are what I would like to parse with. The information in these files is "kind of" "config" information.
Anyway, my point is, no matter what format OF uses, either HDF5 or CGNS or any other "popular" format, the outsiders can then use a relatively "standalone" program to parse OF files "cleanly" without calling OF libraries. |
Quote:
Writing a parser for the OpenFOAM-format is not THAT difficult. I mean: I managed with the parser that is in PyFoam. There are some interesting corner-cases but if you use a parser-generator then writing a parser that correctly reads >90% of all OF-files is pretty straight forward. And in principle the OF-format is just lists and dictionaries so if your programming language supports these then you "only" have to map the parsed data onto those data structures |
Quote:
|
All times are GMT -4. The time now is 20:48. |