Description: Get the sets representing materials and Dirichlet/Neumann boundary conditions and list their contents.
This example shows how to get entity sets, and tags on those sets.
To run: ./SetsNTags [meshfile]
(default values can run if users don't specify a mesh file)
#include <iostream>
using namespace std;
#ifndef MESH_DIR
#define MESH_DIR "."
#endif
int main(
int argc,
char** argv )
{
Range sets, set_ents;
Interface*
mb =
new( std::nothrow ) Core;
if( NULL ==
mb )
return 1;
if( argc > 1 )
{
}
for( int i = 0; i < 3; i++ )
{
sets.clear();
for( set_it = sets.begin(); set_it != sets.end(); ++set_it )
{
int set_id;
rval =
mb->tag_get_data( mtag, &( *set_it ), 1, &set_id );
MB_CHK_ERR( rval );
rval =
mb->get_entities_by_handle( *set_it, set_ents,
true );
MB_CHK_ERR( rval );
cout <<
tag_nms[i] <<
" " << set_id <<
" has " << set_ents.size() <<
" entities:" << endl;
set_ents.print( " " );
set_ents.clear();
}
}
return 0;
}