CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Per-snapshot IO of non-field data (https://www.cfd-online.com/Forums/openfoam-programming-development/161892-per-snapshot-io-non-field-data.html)

knuckles October 31, 2015 00:05

Per-snapshot IO of non-field data
 
Working in OF 2.3.0, I have a model class foo which I'd like to set up to
  1. write special data at each time snapshot and
  2. read that same data when restarting
The data is not a field; it's a collection of statistics which the model calculates and requires for a restart, and I would prefer to keep it all together in a single file. The easiest / most appropriate way of achieving the "single file" objective seems to be having foo inherit from IOdictionary, since IOdictionary already implements all of the methods required to read and write arbitrary data types from/to a single file.

Is this the right way? Is there a better one? I don't want to re-invent the wheel...


All times are GMT -4. The time now is 13:25.