<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">7. 11. 2017 v 19:51, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 7, 2017 at 11:44 AM, Vaclav Hapla<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:vaclav.hapla@erdw.ethz.ch" target="_blank" class="">vaclav.hapla@erdw.ethz.ch</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;" class="">Nico Schlömer just introduced MED support into his meshio tool, based on my issue request. When I convert blockcylinder-50.exo directly to the MED format with meshio, the result can be loaded into GMSH and looks reasonable. But DMPlexCreateMedFromFile denies to open it with the following error:<div class=""><br class=""></div><div class=""><div class="">_MEDmeshAdvancedRd236.c [285] : Erreur de valeur invalide du filtre </div><div class="">_MEDmeshAdvancedRd236.c [285] : </div><div class="">_MEDmeshAdvancedRd236.c [286] : geotype = 0</div><div class="">_MEDmeshAdvancedRd236.c [286] : meshname = "mesh0"</div><div class="">_MEDmeshAdvancedRd236.c [286] : _datagroupname2 = "NOE"</div><div class="">_MEDmeshAdvancedRd236.c [287] : (*_filter).storagemode = 2</div><div class="">[0]PETSC ERROR: #1 DMPlexCreateMedFromFile() line 86 in /scratch/petsc-dev/src/dm/<wbr class="">impls/plex/plexmed.c</div><div class="">[0]PETSC ERROR: #2 DMPlexCreateFromFile() line 2815 in /scratch/petsc-dev/src/dm/<wbr class="">impls/plex/plexcreate.c</div><div class="">[0]PETSC ERROR: #3 main() line 38 in /scratch/petsc-dev/src/dm/<wbr class="">impls/plex/examples/tutorials/<wbr class="">ex5.c</div></div><div class=""><br class=""></div><div class="">Can you see whether it's a bug in DMPlexCreateMedFromFile or the MED file is broken?</div></div></blockquote><div class=""><br class=""></div><div class="">It appears to be an MED incompatibility</div><div class=""><br class=""></div><div class="">  <a href="https://bitbucket.org/petsc/petsc/src/17bd883d72f40a596f2d89b5afda5a233b621464/src/dm/impls/plex/plexmed.c?at=master&fileviewer=file-view-default#plexmed.c-86" class="">https://bitbucket.org/petsc/petsc/src/17bd883d72f40a596f2d89b5afda5a233b621464/src/dm/impls/plex/plexmed.c?at=master&fileviewer=file-view-default#plexmed.c-86</a></div><div class=""><br class=""></div><div class="">We should ask Nico about it.</div></div></div></div></div></blockquote><div><br class=""></div><div>I tried to load the MED file from meshio (attached) by the MED-supplied test $PETSC_ARCH/externalpackages/med-3.2.0/tests/c/test5.c, and it didn't complain. I compared it with DMPlexCreateMedFromFile, replaced MED_COMPACT_STMODE flag by MED_GLOBAL_PFLMODE in MEDfilterBlockOfEntityCr calls (patch attached), and it started to work magically.</div><div><br class=""></div><div>But I have no idea what's the meaning of this flag - I found no documentation of the MED library.</div><div><br class=""></div><div>Note also that your <span style="font-family: Menlo-Regular;" class="">knepley/fix-plex-med-</span><wbr class="" style="font-family: Menlo-Regular;"><span style="font-family: Menlo-Regular;" class="">orientation fix is still needed so I mean this should be applied generally - Nico's meshio is independent of GMSH.</span></div><div><span style="font-family: Menlo-Regular;" class=""><br class=""></span></div><div><span style="font-family: Menlo-Regular;" class="">Vaclav</span></div><div><br class=""></div><div></div></div></body></html>