| 284 | | { "struct", "Conn. and adj. query time for structured mesh", &testA }, |
| 285 | | { "bulk", "Conn. and adj. query time for bulk-created mesh", &testB }, |
| 286 | | { "indiv", "Conn. and adj. query time for per-entity created mesh", &testC }, |
| 287 | | // { "skin", "Test skin time", &skin_time }, |
| 288 | | // { "skin_adj", "Test skin time using vertex-to-element adjacencies", &skin_adj }, |
| 289 | | }; |
| 290 | | |
| | 289 | { "struct", &testA, "Conn. and adj. query time for structured mesh" }, |
| | 290 | { "bulk", &testB, "Conn. and adj. query time for bulk-created mesh" }, |
| | 291 | { "indiv", &testC, "Conn. and adj. query time for per-entity created mesh" }, |
| | 292 | { "skin", &skin_time, "Test time to get skin quads" }, |
| | 293 | { "skin_adj", &skin_adj, "Test skin quads using vert-to-elem adjacencies" }, |
| | 294 | { "skin_vert", &skin_vert, "Test time to get skin verts" }, |
| | 295 | }; |
| 582 | | void testB(const int nelem) |
| 583 | | { |
| 584 | | MBCore moab; |
| 585 | | MBInterface* gMB = &moab; |
| 586 | | double ttime0, ttime1, ttime2, ttime3, utime, stime, mem; |
| 587 | | |
| 588 | | print_time(false, ttime0, utime, stime, mem); |
| 589 | | std::cout << "Ready to read model into MOAB; memory = " << mem/1.0e6 << " MB." << std::endl; |
| 590 | | |
| | 587 | void bulk_construct_mesh( MBInterface* gMB, const int nelem ) |
| | 588 | { |
| | 617 | } |
| | 618 | |
| | 619 | void testB(const int nelem) |
| | 620 | { |
| | 621 | MBCore moab; |
| | 622 | MBInterface* gMB = &moab; |
| | 623 | double ttime0, ttime1, ttime2, ttime3, utime, stime, mem; |
| | 624 | |
| | 625 | print_time(false, ttime0, utime, stime, mem); |
| | 626 | std::cout << "Ready to read model into MOAB; memory = " << mem/1.0e6 << " MB." << std::endl; |
| | 627 | |
| | 628 | bulk_construct_mesh( gMB, nelem ); |
| | 724 | |
| | 725 | void skin_time( const int nelem ) |
| | 726 | { |
| | 727 | MBCore moab; |
| | 728 | MBInterface* gMB = &moab; |
| | 729 | MBErrorCode rval; |
| | 730 | |
| | 731 | bulk_construct_mesh( gMB, nelem ); |
| | 732 | |
| | 733 | MBRange skin, hexes; |
| | 734 | rval = gMB->get_entities_by_dimension( 0, 3, hexes ); |
| | 735 | assert(MB_SUCCESS == rval); assert(!hexes.empty()); |
| | 736 | |
| | 737 | MBSkinner tool(gMB); |
| | 738 | clock_t t = clock(); |
| | 739 | rval = tool.find_skin( hexes, 2, skin, false ); |
| | 740 | double d = ((double)(clock() - t))/CLOCKS_PER_SEC; |
| | 741 | assert(MB_SUCCESS == rval); |
| | 742 | |
| | 743 | std::cout << "Got 2D skin in " << d << " seconds w/out vertex-to-element adjacencies" << std::endl; |
| | 744 | } |
| | 745 | |
| | 746 | void skin_adj( const int nelem ) |
| | 747 | { |
| | 748 | MBCore moab; |
| | 749 | MBInterface* gMB = &moab; |
| | 750 | MBErrorCode rval; |
| | 751 | |
| | 752 | bulk_construct_mesh( gMB, nelem ); |
| | 753 | |
| | 754 | MBRange skin, verts, hexes; |
| | 755 | // force creation of adjacencies |
| | 756 | rval = gMB->get_entities_by_dimension( 0, 0, verts ); |
| | 757 | assert(MB_SUCCESS == rval); assert(!verts.empty()); |
| | 758 | rval = gMB->get_adjacencies( verts, 3, false, hexes ); |
| | 759 | assert(MB_SUCCESS == rval); assert(!hexes.empty()); |
| | 760 | |
| | 761 | MBSkinner tool(gMB); |
| | 762 | clock_t t = clock(); |
| | 763 | rval = tool.find_skin( hexes, 2, skin, true ); |
| | 764 | double d = ((double)(clock() - t))/CLOCKS_PER_SEC; |
| | 765 | assert(MB_SUCCESS == rval); |
| | 766 | |
| | 767 | std::cout << "Got 2D skin in " << d << " seconds with vertex-to-element adjacencies" << std::endl; |
| | 768 | } |
| | 769 | |
| | 770 | void skin_vert( const int nelem ) |
| | 771 | { |
| | 772 | MBCore moab; |
| | 773 | MBInterface* gMB = &moab; |
| | 774 | MBErrorCode rval; |
| | 775 | |
| | 776 | bulk_construct_mesh( gMB, nelem ); |
| | 777 | |
| | 778 | MBRange skin, hexes; |
| | 779 | rval = gMB->get_entities_by_dimension( 0, 3, hexes ); |
| | 780 | assert(MB_SUCCESS == rval); assert(!hexes.empty()); |
| | 781 | |
| | 782 | MBSkinner tool(gMB); |
| | 783 | clock_t t = clock(); |
| | 784 | rval = tool.find_skin( hexes, 0, skin, false ); |
| | 785 | double d = ((double)(clock() - t))/CLOCKS_PER_SEC; |
| | 786 | assert(MB_SUCCESS == rval); |
| | 787 | |
| | 788 | std::cout << "Got 0D skin in " << d << " seconds w/out vertex-to-element adjacencies" << std::endl; |
| | 789 | } |