#include #include #include #include #include #include #include #define RR if (MB_SUCCESS !=result) assert(0); #define RRFAILURE if (MB_FAILURE ==result) assert(0); #define EE(MOAB) if (MB_SUCCESS !=result) { \ std::string error_info; \ MOAB->get_last_error(error_info); \ std::cout<<"error info "<create_meshset(MESHSET_TRACK_OWNER,cube);RR result = moab->load_file("2_tets.vtk", &cube);RR MBRange tets; result = moab->get_entities_by_type(cube,MBTET,tets);RR MBRange faces; result = moab->get_adjacencies(tets,2,true,faces,MBInterface::UNION);faces.print(); MBRange face_connected;//shared face between the two tets result = moab->get_adjacencies(tets,2,true,face_connected,MBInterface::INTERSECT);face_connected.print(); MBEntityHandle face = face_connected[0]; MBEntityHandle old_node=7;//one node on the shared face MBEntityHandle new_node; double coord[3]; result = moab->get_coords(&old_node,1,coord); result = moab->create_vertex(coord,new_node);RR //Creates the New Node MBEntityHandle T=tets[0];//tet where connectivity to be changed MBRange faces_before; moab->get_adjacencies(&T,1,2,false,faces_before);faces_before.print(); const MBEntityHandle* conn; int nb_nodes; result = moab->get_connectivity(T,conn,nb_nodes);RR MBEntityHandle new_conn[nb_nodes]; for(int ii=0;iiset_connectivity(T,new_conn,nb_nodes);RR //Set new connectivity result = moab->remove_adjacencies(T,&face,1);RR//remove old face MBRange faces_after; moab->get_adjacencies(&T,1,2,true,faces_after);faces_after.print(); printf("\n"); delete moab; return 0; }