Med switch mode handling
Med switch mode handlingPosted by A.Leufroy at December 07. 2012
I'd like to use MED as the native file format in a project.
I've got some troubles to handle correctly the data switch mode (MED_FULL_INTERLACE/MED_NO_INTERLACE). In fact it seems that this information is not saved into the med file (I only found "nbr" and "cgt" as dataset attributes).
Is there a way to introspect the data switch mode from med file ?
Looking from the paravis source code, only the MED_FULL_INTERLACE is supported (see for instance MedmeshNodeCoordinateRd(...) in vtkMedDriver30.cxx).
Re: Med switch mode handlingPosted by Gérald NICOLAS at December 10. 2012
You are right: the information MED_FULL_INTERLACE/MED_NO_INTERLACE is not saved into the file. The reason is that it is useless. In fact, we don't know how the arrays are stored. And we don't care because we'll never inspect directly the file: every action is made through the MED library.
The interest of MED_FULL_INTERLACE/MED_NO_INTERLACE is that you manage the I/O according to the description of the array in your project. If the array to be written down is managed with the MED_FULL_INTERLACE mode, choose it. Then, when the file is read by another software, the parameter MED_FULL_INTERLACE/MED_NO_INTERLACE will be given such as it corresponds to the structure that will be used later. With this strategy, if the data in your med file are exchanged between two software and if the storage is not the same into the two software, you don't have to code any conversion: MED library will do it for you.
Am I clear ?
Activate by A.Leufroy on Dec 07, 2012 03:14 PM