25 code =
mb.get_error_string( err );
26 std::cerr <<
"Error: " << code << std::endl;
27 if( !message.empty() ) std::cerr <<
" " << message << std::endl;
31 #define CHKERR( err ) \
34 if( moab::MB_SUCCESS != ( err ) ) \
36 print_error( mb, ( err ) ); \
37 std::cerr << "Unexpected failure at: " << __FILE__ << ":" << __LINE__ << std::endl; \
54 std::cout <<
"Hex mesh file name: ";
68 std::cerr << filename <<
": file containd no hexahedra" << std::endl;
83 std::cout <<
"Point coordinates: ";
84 if( !( std::cin >> point[0] >> point[1] >> point[2] ) )
break;
87 MB_CHK_SET_ERR( tool.leaf_containing_point( tree_root, point, leaf ),
"Failed to find leaf containing point" );
90 std::cout <<
"Point is not contained in any hexahedron." << std::endl;
107 std::vector< moab::EntityHandle > hexes;
111 std::vector< moab::EntityHandle >::const_iterator i;
112 for( i = hexes.begin(); i != hexes.end(); ++i )
114 MB_CHK_SET_ERR(
mb.get_connectivity( *i, conn, conn_len ),
"Failed to get connectivity" );
115 MB_CHK_SET_ERR(
mb.get_coords( conn, 8, &coords[0][0] ),
"Failed to get coordinates" );
126 int id =
mb.id_from_handle( hex );
131 mb.get_connectivity( hex, conn, conn_len );
134 double coords[3 * 8];
135 mb.get_coords( conn, 8, coords );
138 std::cout <<
" Point is in hex " <<
id <<
" with corners: " << std::endl;
139 for(
int i = 0; i < 8; ++i )
141 std::cout <<
" (" << coords[3 * i] <<
", " << coords[3 * i + 1] <<
", " << coords[3 * i + 2] <<
")"