21 iBase_EntitySetHandle root_set;
24 iBase_EntityArrIterator iter;
36 printf(
"Usage: %s <mesh_filename>\n", argv[0] );
41 iMesh_newMesh( NULL, &mesh, &err, 0 );
CHKERR( err,
"Failed to create a mesh instance.\n" );
42 iMesh_getRootSet( mesh, &root_set, &err );
CHKERR( err,
"Failed to return a root set.\n" );
44 iMesh_load( mesh, root_set, filename, NULL, &err, strlen( filename ), 0 );
47 iMesh_getNumOfType( mesh, root_set, iBase_REGION, &num_regions, &err );
CHKERR( err,
"Failed to get number of regions." );
50 iMesh_initEntArrIter( mesh, root_set, iBase_REGION, iMesh_ALL_TOPOLOGIES, num_regions, 0, &iter, &err );
CHKERR( err,
"Failed to create iterator over regions." );
53 iMesh_createTagWithOptions( mesh,
"dumtag",
"moab:TAG_STORAGE_TYPE=DENSE moab:TAG_DEFAULT_VALUE=0.0", 1,
54 iBase_DOUBLE, &tagh, &err, 6, 54 );
CHKERR( err,
"Failed to create a tag.\n" );
63 iMesh_tagIterate( mesh, tagh, iter, &tag_data, &count, &err );
CHKERR( err,
"Failed to create a tag.\n" );
66 iMesh_stepEntArrIter( mesh, iter, count, &atend, &err );
CHKERR( err,
"Failed to step iterator.\n" );
71 iMesh_dtor( mesh, &err );
CHKERR( err,
"Failed to destroy iMesh instance.\n" );