|
Developer Documentation
|
The OpenVolumeMesh library defines and implements two file formats, the classic text-based *.ovm format (cf. Text-based File Format ) as well as a newer binary format, *.ovmb. (cf. Binary File Format )
We recommend saving files in the *.ovmb file format, it is more space efficient, faster to read and write and has better support for custom property types.
The OpenVolumeMesh library is equipped with a file manager class that allows reading polyhedral meshes from file as well as writing mesh objects to files. The format for these files is specified in Section File formats.
In this tutorial, we will learn how to use the file manager in order to permanently store mesh objects and read them.
Consider the following code for an example on how to write a polyhedral mesh to a file:
This works analogously for reading files into mesh objects. See the following code for an example.
Function OpenVolumeMesh::IO::FileManager::readFile() expects a total of four parameters, two of which are mandatory (file name and mesh reference). The other two parameters are optional flags that control whether bottom-up incidences should be computed automatically and whether a topology check should be performed when adding faces and cells. The two flags are turned on per default.