[MOAB-dev] Tag values problem,

Iulian Grindeanu iulian at mcs.anl.gov
Sat Jul 13 17:52:32 CDT 2013


Hello Lukasz, 

----- Original Message -----

| Hello,

| 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,

| //CASE 1
| rval = moab.tag_get_handle("_RefParentHandle",sizeof(EntityHandle),
| MB_TYPE_OPAQUE,th_RefParentHandle,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&no_handle);
| CHKERR(rval); CHKERR_THROW(rval);

| or

| //CASE 2
| rval = moab.tag_get_handle("_RefParentHandle",1,
| MB_TYPE_HANDLE,th_RefParentHandle,MB_TAG_CREAT|MB_TAG_SPARSE,&no_handle);
| CHKERR(rval); CHKERR_THROW(rval);

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. 
for type MB_ENTITY_HANDLE, during writing, it will try to map with an actual handle, and it will not be able to. 
It should probably give some warning at least. 
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. 
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; 
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. 

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 :) 

I did not compile your code, are there any instructions? I see that for cmake you need some file to be defined. (for PETSc?) 

Best regards, 
Iulian 

| I save mesh in native moab format and read it once again.

| In CASE 1, moab works as expected, no problem. See example file
| restart_case1.h5m.
| In CASE 2, moab generate error,
| Error code 10 at
| /Users/likask/MyBuild/mofem-bitbucket/mofem_v0.0.1/do_not_blink/moabField_Core.cpp:46
| See example file restart_case2.h5m

| 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.

| If you need more details about my code, you can find code here,
| https://bitbucket.org/likask/mofem-joseph/overview
| Tag:
| v0.0.1.1_moab_problem_with_tag

| Thanks for help,
| Regards,
| Lukasz Kaczmarczyk
| Lecturer
| School of Engineering,
| University of Glasgow,
| GLASGOW, G12 8LT
| Tel: +44 141 3308113
| email: likask at civil.gla.ac.uk
| web: http://userweb.eng.gla.ac.uk/lukasz.kaczmarczyk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20130713/8925c1f3/attachment.html>


More information about the moab-dev mailing list