<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="">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/impls/plex/plexmed.c</div><div class="">[0]PETSC ERROR: #2 DMPlexCreateFromFile() line 2815 in /scratch/petsc-dev/src/dm/impls/plex/plexcreate.c</div><div class="">[0]PETSC ERROR: #3 main() line 38 in /scratch/petsc-dev/src/dm/impls/plex/examples/tutorials/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 class=""><br class=""></div><div class="">Thanks</div><div class=""><br class=""></div><div class="">Vaclav</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">5. 11. 2017 v 18:48, 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 Thu, Nov 2, 2017 at 12:08 PM, 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;">It seems that DMPlexCreateMedFromFile leaves out some mesh elements. I found it out when investigating why ParMetis redistribution crashes.<br class=""><br class="">I attach the datafile $PETSC_DIR/share/petsc/<wbr class="">datafiles/meshes/<wbr class="">blockcylinder-50.exo converted to GMSH and MED format.<br class="">The conversion EXO to GMSH was done by meshio (<a href="http://github.com/nschloe/meshio" rel="noreferrer" target="_blank" class="">github.com/nschloe/meshio</a>), and GMSH to MED by GMSH itself.<br class=""><br class="">I did:<br class=""><br class="">cd $PETSC_DIR/src/dm/impls/plex/<wbr class="">examples/tutorials<br class="">make ex5<br class="">FILE=blockcylinder-50.exo && ./ex5 -filename $FILE -dm_view hdf5:$FILE.h5 && $PETSC_DIR/bin/petsc_gen_xdmf.<wbr class="">py $FILE.h5<br class="">FILE=blockcylinder-50.msh && ./ex5 -filename $FILE -dm_view hdf5:$FILE.h5 && $PETSC_DIR/bin/petsc_gen_xdmf.<wbr class="">py $FILE.h5<br class="">FILE=blockcylinder-50.med && ./ex5 -filename $FILE -dm_view hdf5:$FILE.h5 && $PETSC_DIR/bin/petsc_gen_xdmf.<wbr class="">py $FILE.h5<br class=""><br class="">While the output from blockcylinder-50.exo and blockcylinder-50.msh looks OK, that from blockcylinder-50.med is corrupted.<br class=""><br class="">I also attach my HDF5/XDMF outputs and screenshots from ParaView.</blockquote><div class=""><br class=""></div><div class="">It appears that MED, at least coming from GMsh, inverts hexes just like GMsh does. I have fixed this in branch</div><div class=""><br class=""></div><div class="">  knepley/fix-plex-med-orientation</div><div class=""><br class=""></div><div class="">If you run your test in this, everything should be fine.</div><div class=""><br class=""></div><div class="">Michael, can you check whether this is a general fix, or it only applied to MED from GMsh?</div><div class=""><br class=""></div><div class="">  Thanks,</div><div class=""><br class=""></div><div class="">     Matt</div><div class=""> </div><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;"><span class="HOEnZb"><font color="#888888" class=""><br class="">Vaclav<br class=""><br class=""></font></span><br class=""><br class=""><br class=""><br class=""><br class=""><br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.caam.rice.edu/~mk51/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div></div></div></div></div></div></div></div></blockquote></div><br class=""></div></body></html>