<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>Hello Lukasz,<br><br><hr id="zwchr"><blockquote id="DWT265" style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">Hello,<br><br>I storing entity handle on tags. I use that to store handle to parent element in edge mesh refine algorithm. To create tag I use,<br><br>//CASE 1<br> rval = moab.tag_get_handle("_RefParentHandle",sizeof(EntityHandle),<br>        MB_TYPE_OPAQUE,th_RefParentHandle,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&no_handle); CHKERR(rval); CHKERR_THROW(rval);<br><br>or<br><br>//CASE 2<br> rval = moab.tag_get_handle("_RefParentHandle",1,<br>        MB_TYPE_HANDLE,th_RefParentHandle,MB_TAG_CREAT|MB_TAG_SPARSE,&no_handle); CHKERR(rval); CHKERR_THROW(rval);<br><br></blockquote>I think the issue is "no_handle" definition in your code. EntityHandle is basically unsigned long int. (-1) will be probably converted to 0xfff...fff, but I think it depends on compiler.<br>for type MB_ENTITY_HANDLE, during writing, it will try to map with an actual handle, and it will not be able to.<br>It should probably give some warning at least. <br>It is not advisable to use OPAQUE type, because it will just set the handle in bytes. If some reordering is involved, you could get a different handle than you expect.<br>Would it be difficult to use 0 as default in your code? (root set?) Nobody should have as "parent" the root set, but I am not understanding your code enough; <br>Or create an actual entity (or an entity set) that you know that you will never use, and use that for default. I assume that you need a default, but maybe you don't. <br><br>I looked a little at your h5m files, there are a lot of tags, nice and elaborate work :) I hope you keep track of them :)<br><br>I did not compile your code, are there any instructions? I see that for cmake you need some file to be defined. (for PETSc?)<br><br>Best regards,<br>Iulian<br><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><br>I save mesh in native moab format and read it once again. <br><br>In CASE 1, moab works as expected, no problem. See example file restart_case1.h5m. <br>In CASE 2, moab generate error,<br>Error code  10 at /Users/likask/MyBuild/mofem-bitbucket/mofem_v0.0.1/do_not_blink/moabField_Core.cpp:46<br>See example file restart_case2.h5m<br><br>I don't know if error is result of my ignorance about moab, or problem is somewhere in moab implementation. I using version moab-4.6.0. <br><br><br>If you need more details about my code, you can find code here, <br>https://bitbucket.org/likask/mofem-joseph/overview<br>Tag: <br>v0.0.1.1_moab_problem_with_tag<br><br>Thanks for help,<br>Regards,<br>Lukasz Kaczmarczyk<br>Lecturer<br>School of Engineering,<br>University of Glasgow,<br>GLASGOW, G12 8LT<br>Tel: +44 141 3308113<br>email: likask@civil.gla.ac.uk<br>web: http://userweb.eng.gla.ac.uk/lukasz.kaczmarczyk<br><br><br><br><br></blockquote><br></div></body></html>