ENSIGHT_MESH_RDONLY_DRIVER fail to read .geo file (EOF)
I wanted to convert directly ensight file to med file.
The meshDriver is not able to read geo file written in Ensight Gold Binary Standard.
I read it with paraview (insode SALOME env.) and it works great. It also works with customised python script ensightMedEnsight_test.py
Can somebody tell me why this code does not work with my .geo file (see attachment) ?
There is an expected EOF and it fails at countPartsBinary.
I am using SALOME 6.5.0-WIN32-DEV-DEBUG
Thanks in advance.
Here is the trace :
- Trace W:\temp\NMAKE\SALOME-6.5.0-WIN32-SDK\MODULES\MED\MED_SRC\src\MEDMEM\MEDMEM_EnsightMeshDriver.cxx [167] : Normal end of: ENSIGHT_MESH_DRIVER:
pen() :
--------------
-> Entering into the geometry file C:\cache\ENSIGHTWORKDIR\star00000.geo
--------------
- Trace W:\temp\NMAKE\SALOME-6.5.0-WIN32-SDK\MODULES\MED\MED_SRC\src\MEDMEM\MEDMEM_EnsightMeshDriver.cxx [1855] : Begin of: ENSIGHT_MESH_RDONLY_DRIVER::readGoldBinary() :
--------------
- Trace W:\temp\NMAKE\SALOME-6.5.0-WIN32-SDK\MODULES\MED\MED_SRC\src\MEDMEM\MEDMEM_Exception.cxx [119] : MED Exception : Unexpected EOF C:\cache\ENSIGHTWORKDIR\star00000.geo
- Trace W:\temp\NMAKE\SALOME-6.5.0-WIN32-SDK\MODULES\MED\MED_SRC\src\MEDMEM\MEDMEM_Exception.cxx [119] : MED Exception : ENSIGHT_MESH_RDONLY_DRIVER::countPartsBinary() : unexpected line:
════════════════════════════════════════════════════════════════════════════════
- Trace W:\temp\NMAKE\SALOME-6.5.0-WIN32-SDK\MODULES\MED\MED_SRC\src\MEDMEM\MEDMEM_Exception.cxx [119] : MED Exception : ENSIGHT_MESH_RDONLY_DRIVER::readGoldBinary() : unexpected line in C:\cache\ENSIGHTWORKDIR\star00000.geo
════════════════════════════════════════════════════════════════════════════════
Re: ENSIGHT_MESH_RDONLY_DRIVER fail to read .geo file (EOF)
Hello Tomas
I explored your file and found that it was not read because of 2 excess bytes, at the end of .geo file, being non-conformal with Binary C format. If you remove them, I hope you will be able to convert your file.
Don't use ensight2med convertor, it works OK only if the file includes fields and it crashes if there is only a mesh in the file.
Best regards
Edward
Re: ENSIGHT_MESH_RDONLY_DRIVER fail to read .geo file (EOF)
Thanks for your answer.
Ensight file is coming from another software so I can't remove the last two bytes. I didn't know how to make in C/C++ so I remove the last two bytes from my file with :
'tail -c 2 star00000.geo > star00000new.geo" in linux then change the name of geom file in .case.
It's not working and it's not working anymore in paraview.
I have a few questions :
- How did you noticed that there were two unwanted bytes ?
- Why is it possible to import 'Non conformal" Ensight C Binary File in Paraview ? If you have an idea...
I attached a main.cpp (piece of ensight2med program).
Regards,
Thomas
Re: ENSIGHT_MESH_RDONLY_DRIVER fail to read .geo file (EOF)
Ensight file is coming from another software so I can't remove the last two bytes. I didn't know how to make in C/C++ so I remove the last two bytes from my file with :
'tail -c 2 star00000.geo > star00000new.geo" in linux then change the name of geom file in .case.
I'm afraid that this command is wrong for our case as man on tail says:
" -c, --bytes=K
output the last K bytes; alternatively, use +K to output bytes starting with
the Kth of each file"
i.e. you got a file of 2 bytes size.
I coped this so: open the file in Emacs, jump to the file end, hit twice [backspace], that's all 
I have a few questions :
- How did you noticed that there were two unwanted bytes ?
I debugged MEDMEM Ensight driver.
- Why is it possible to import 'Non conformal" Ensight C Binary File in Paraview ? If you have an idea...
Probably due to its permissive politic: the most of the file is OK except pending 2 bytes. MEDMEM behavior is not permissive, it throws an exception if anything is wrong. In this case, MEDMEM Ensight driver expects some data conforming to the format or EOF but encounters some garbage.
Best Regards,
Edward
