31 result =
MBI->get_connectivity( quad, quad_conn, n_verts );
32 assert( 4 == n_verts );
36 std::vector< CartVect > coords( n_verts );
37 result =
MBI->get_coords( quad_conn, n_verts, coords[0].array() );
39 CartVect diagA = coords[0] - coords[2];
41 CartVect diagB = coords[1] - coords[3];
46 if( lenA_sqr < lenB_sqr )
48 tri0_conn[0] = quad_conn[0];
49 tri0_conn[1] = quad_conn[1];
50 tri0_conn[2] = quad_conn[2];
51 tri1_conn[0] = quad_conn[0];
52 tri1_conn[1] = quad_conn[2];
53 tri1_conn[2] = quad_conn[3];
57 tri0_conn[0] = quad_conn[0];
58 tri0_conn[1] = quad_conn[1];
59 tri0_conn[2] = quad_conn[3];
60 tri1_conn[0] = quad_conn[1];
61 tri1_conn[1] = quad_conn[2];
62 tri1_conn[2] = quad_conn[3];
66 result =
MBI->create_element(
MBTRI, tri0_conn, 3, tri0 );
68 result =
MBI->create_element(
MBTRI, tri1_conn, 3, tri1 );
99 id_tag =
MBI->globalId_tag();
102 Range surface_meshsets;
104 void* input_dim[] = { &
dim };
105 result =
MBI->get_entities_by_type_and_tag( input_meshset,
MBENTITYSET, &geom_tag, input_dim, 1, surface_meshsets );
107 std::cout << surface_meshsets.
size() <<
" surfaces found." << std::endl;
117 result =
MBI->tag_get_data( id_tag, &( *i ), 1, &surf_id );
119 std::cout <<
" Surface " << surf_id <<
" has ";
123 result =
MBI->get_entities_by_type( *i,
MBQUAD, quads );
125 std::cout << quads.
size() <<
" quads." << std::endl;
139 result =
MBI->add_entities( *i, &tri0, 1 );
140 if(
MB_SUCCESS != result ) std::cout <<
"result=" << result << std::endl;
142 result =
MBI->add_entities( *i, &tri1, 1 );
146 result =
MBI->remove_entities( *i, &( *j ), 1 );
150 result =
MBI->delete_entities( &( *j ), 1 );