<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 9, 2017 at 11:15 AM, Vaclav Hapla <span dir="ltr"><<a href="mailto:vaclav.hapla@erdw.ethz.ch" target="_blank">vaclav.hapla@erdw.ethz.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>7. 11. 2017 v 19:51, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>>:</div><span class="gmail-"><br class="gmail-m_147740135073456798Apple-interchange-newline"><div><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"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 7, 2017 at 11:44 AM, Vaclav Hapla<span class="gmail-m_147740135073456798Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:vaclav.hapla@erdw.ethz.ch" target="_blank">vaclav.hapla@erdw.ethz.<wbr>ch</a>></span><span class="gmail-m_147740135073456798Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">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><br></div><div><div>_MEDmeshAdvancedRd236.c [285] : Erreur de valeur invalide du filtre </div><div>_MEDmeshAdvancedRd236.c [285] : </div><div>_MEDmeshAdvancedRd236.c [286] : geotype = 0</div><div>_MEDmeshAdvancedRd236.c [286] : meshname = "mesh0"</div><div>_MEDmeshAdvancedRd236.c [286] : _datagroupname2 = "NOE"</div><div>_MEDmeshAdvancedRd236.c [287] : (*_filter).storagemode = 2</div><div>[0]PETSC ERROR: #1 DMPlexCreateMedFromFile() line 86 in /scratch/petsc-dev/src/dm/impl<wbr>s/plex/plexmed.c</div><div>[0]PETSC ERROR: #2 DMPlexCreateFromFile() line 2815 in /scratch/petsc-dev/src/dm/impl<wbr>s/plex/plexcreate.c</div><div>[0]PETSC ERROR: #3 main() line 38 in /scratch/petsc-dev/src/dm/impl<wbr>s/plex/examples/tutorials/ex5.<wbr>c</div></div><div><br></div><div>Can you see whether it's a bug in DMPlexCreateMedFromFile or the MED file is broken?</div></div></blockquote><div><br></div><div>It appears to be an MED incompatibility</div><div><br></div><div>  <a href="https://bitbucket.org/petsc/petsc/src/17bd883d72f40a596f2d89b5afda5a233b621464/src/dm/impls/plex/plexmed.c?at=master&fileviewer=file-view-default#plexmed.c-86" target="_blank">https://bitbucket.org/petsc/<wbr>petsc/src/<wbr>17bd883d72f40a596f2d89b5afda5a<wbr>233b621464/src/dm/impls/plex/<wbr>plexmed.c?at=master&<wbr>fileviewer=file-view-default#<wbr>plexmed.c-86</a></div><div><br></div><div>We should ask Nico about it.</div></div></div></div></div></span></blockquote><div><br></div><div>I tried to load the MED file from meshio (attached) by the MED-supplied test $PETSC_ARCH/externalpackages/<wbr>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></div></blockquote><div><br></div><div>The people who write MED should be shot, or at least severely beaten so they can still document this stuff. Here is code using COMPACT</div><div><br></div><div>  <a href="https://github.com/cycheung/gmsh/blob/master/Post/PViewDataGModelIO.cpp#L581">https://github.com/cycheung/gmsh/blob/master/Post/PViewDataGModelIO.cpp#L581</a></div><div><br></div><div>I am reluctant to change things without a reason.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><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></div><div>Note also that your <span style="font-family:Menlo-Regular">knepley/fix-plex-med-</span><span style="font-family:Menlo-Regular">orie<wbr>ntation fix is still needed so I mean this should be applied generally - Nico's meshio is independent of GMSH.</span></div><span class="gmail-HOEnZb"><font color="#888888"><div><span style="font-family:Menlo-Regular"><br></span></div><div><span style="font-family:Menlo-Regular">Vaclav</span></div><div><br></div><div></div></font></span></div></div><br><div style="word-wrap:break-word"><div class="gmail-m_4240987127671984628AppleOriginalContents"><div class="gmail-m_4240987127671984628AppleOriginalContents"></div></div></div><br><div style="word-wrap:break-word"><div><div></div><br><blockquote type="cite"><div><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"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div> <span class="gmail-m_2602364368773268427Apple-converted-space"> </span>Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>Thanks</div><div><br></div><div>Vaclav</div><div><br></div><div><br><div><blockquote type="cite"><div>5. 11. 2017 v 18:48, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>>:</div><br class="gmail-m_2602364368773268427gmail-m_4979144052757038927Apple-interchange-newline"><div><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"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 2, 2017 at 12:08 PM, Vaclav Hapla<span class="gmail-m_2602364368773268427gmail-m_4979144052757038927Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:vaclav.hapla@erdw.ethz.ch" target="_blank">vaclav.hapla@erdw.ethz.<wbr>ch</a>></span><span class="gmail-m_2602364368773268427gmail-m_4979144052757038927Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid 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><br>I attach the datafile $PETSC_DIR/share/petsc/datafil<wbr>es/meshes/blockcylinder-50.exo converted to GMSH and MED format.<br>The conversion EXO to GMSH was done by meshio (<a href="http://github.com/nschloe/meshio" rel="noreferrer" target="_blank">github.com/nschloe/meshio</a>), and GMSH to MED by GMSH itself.<br><br>I did:<br><br>cd $PETSC_DIR/src/dm/impls/plex/e<wbr>xamples/tutorials<br>make ex5<br>FILE=blockcylinder-50.exo && ./ex5 -filename $FILE -dm_view hdf5:$FILE.h5 && $PETSC_DIR/bin/petsc_gen_xdmf.<wbr>py $FILE.h5<br>FILE=blockcylinder-50.msh && ./ex5 -filename $FILE -dm_view hdf5:$FILE.h5 && $PETSC_DIR/bin/petsc_gen_xdmf.<wbr>py $FILE.h5<br>FILE=blockcylinder-50.med && ./ex5 -filename $FILE -dm_view hdf5:$FILE.h5 && $PETSC_DIR/bin/petsc_gen_xdmf.<wbr>py $FILE.h5<br><br>While the output from blockcylinder-50.exo and blockcylinder-50.msh looks OK, that from blockcylinder-50.med is corrupted.<br><br>I also attach my HDF5/XDMF outputs and screenshots from ParaView.</blockquote><div><br></div><div>It appears that MED, at least coming from GMsh, inverts hexes just like GMsh does. I have fixed this in branch</div><div><br></div><div> <span class="gmail-m_2602364368773268427Apple-converted-space"> </span>knepley/fix-plex-med-orienta<wbr>tion</div><div><br></div><div>If you run your test in this, everything should be fine.</div><div><br></div><div>Michael, can you check whether this is a general fix, or it only applied to MED from GMsh?</div><div><br></div><div> <span class="gmail-m_2602364368773268427Apple-converted-space"> </span>Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-m_2602364368773268427gmail-m_4979144052757038927HOEnZb"><font color="#888888"><br>Vaclav<br><br></font></span><br><br><br><br><br><br></blockquote></div><br><br clear="all"><span class="gmail-m_2602364368773268427gmail-HOEnZb"><font color="#888888"><div><br></div>--<span class="gmail-m_2602364368773268427gmail-m_4979144052757038927Apple-converted-space"> </span><br><div class="gmail-m_2602364368773268427gmail-m_4979144052757038927gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~k<wbr>nepley/</a></div></div></div></div></div></font></span></div></div></div></blockquote></div><br></div></div></blockquote></div><br><br clear="all"><div><br></div>--<span class="gmail-m_2602364368773268427Apple-converted-space"> </span><br><div class="gmail-m_2602364368773268427gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~<wbr>knepley/</a></div></div></div></div></div></div></div></div></blockquote></div><br></div><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>