Changeset 7393
- Timestamp:
- Aug 20, 2009, 1:50:28 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga_parallel/test_distribute_mesh.py
r7392 r7393 472 472 #print submeshf 473 473 474 true_submeshf = {'full_triangles': [[[4, 9, 3], [4, 12, 5], [7, 12, 4], [8, 12, 7], [5, 12, 8]], [[0, 9, 1], [1, 9, 4], [1, 10, 2], [4, 10, 1], [5, 10, 4], [2, 10, 5]], [[3, 9, 0], [3, 11, 4], [6, 11, 3], [7, 11, 6], [4, 11, 7]]], 'full_nodes': [num.array([[ 3. , 0.5 , 0. ], 474 true_submesh = {'full_boundary': [{(3, 1): 'right', (4, 1): 'top'}, {(5, 1): 'left', (10, 1): 'top', (7, 1): 'left'}, {(13, 1): 'bottom', (14, 1): 'right', (11, 1): 'bottom'}], 475 'ghost_nodes': [num.array([[ 0. , 0. , 0. ], 476 [ 1. , 0. , 0.5 ], 477 [ 2. , 0. , 1. ], 478 [ 6. , 1. , 0. ], 479 [ 10. , 0.25, 0.75], 480 [ 11. , 0.75, 0.25]]), num.array([[ 3. , 0.5 , 0. ], 481 [ 7. , 1. , 0.5 ], 482 [ 8. , 1. , 1. ], 483 [ 11. , 0.75, 0.25], 484 [ 12. , 0.75, 0.75]]), num.array([[ 1. , 0. , 0.5 ], 485 [ 5. , 0.5 , 1. ], 486 [ 8. , 1. , 1. ], 487 [ 12. , 0.75, 0.75]])], 'full_nodes': [num.array([[ 3. , 0.5 , 0. ], 475 488 [ 4. , 0.5 , 0.5 ], 476 489 [ 5. , 0.5 , 1. ], … … 490 503 [ 7. , 1. , 0.5 ], 491 504 [ 9. , 0.25, 0.25], 492 [ 11. , 0.75, 0.25]])], 'full_boundary': [{(3, 1): 'right', (4, 1): 'top'}, {(5, 1): 'left', (10, 1): 'top', (7, 1): 'left'}, {(13, 1): 'bottom', (14, 1): 'right', (11, 1): 'bottom'}]} 493 494 495 496 for key, item in submeshf.iteritems(): 497 assert submeshf[key] == true_submeshf[key] , 'submeshf[%s] ' % key 498 505 [ 11. , 0.75, 0.25]])], 'ghost_triangles': [num.array([[ 5, 0, 9, 1], 506 [ 6, 1, 9, 4], 507 [ 8, 4, 10, 1], 508 [ 9, 5, 10, 4], 509 [10, 2, 10, 5], 510 [11, 3, 9, 0], 511 [12, 3, 11, 4], 512 [13, 6, 11, 3], 513 [14, 7, 11, 6], 514 [15, 4, 11, 7]]), num.array([[ 0, 4, 9, 3], 515 [ 1, 4, 12, 5], 516 [ 2, 7, 12, 4], 517 [ 4, 5, 12, 8], 518 [11, 3, 9, 0], 519 [12, 3, 11, 4]]), num.array([[ 0, 4, 9, 3], 520 [ 1, 4, 12, 5], 521 [ 2, 7, 12, 4], 522 [ 3, 8, 12, 7], 523 [ 5, 0, 9, 1], 524 [ 6, 1, 9, 4]])], 'ghost_boundary': [{(13, 1): 'ghost', (8, 0): 'ghost', (14, 1): 'ghost', (11, 1): 'ghost', (10, 1): 'ghost', (5, 1): 'ghost', (10, 2): 'ghost'}, {(12, 2): 'ghost', (12, 0): 'ghost', (2, 1): 'ghost', (11, 1): 'ghost', (2, 2): 'ghost', (4, 1): 'ghost', (4, 0): 'ghost'}, {(3, 2): 'ghost', (6, 1): 'ghost', (3, 1): 'ghost', (5, 1): 'ghost', (1, 0): 'ghost', (1, 1): 'ghost'}], 'full_triangles': [[[4, 9, 3], [4, 12, 5], [7, 12, 4], [8, 12, 7], [5, 12, 8]], [[0, 9, 1], [1, 9, 4], [1, 10, 2], [4, 10, 1], [5, 10, 4], [2, 10, 5]], [[3, 9, 0], [3, 11, 4], [6, 11, 3], [7, 11, 6], [4, 11, 7]]], 'full_commun': [{0: [1, 2], 1: [1, 2], 2: [1, 2], 3: [2], 4: [1]}, {5: [0, 2], 6: [0, 2], 7: [], 8: [0], 9: [0], 10: [0]}, {11: [0, 1], 12: [0, 1], 13: [0], 14: [0], 15: [0]}], 'ghost_commun': [num.array([[ 5, 1], 525 [ 6, 1], 526 [ 8, 1], 527 [ 9, 1], 528 [10, 1], 529 [11, 2], 530 [12, 2], 531 [13, 2], 532 [14, 2], 533 [15, 2]]), num.array([[ 0, 0], 534 [ 1, 0], 535 [ 2, 0], 536 [ 4, 0], 537 [11, 2], 538 [12, 2]]), num.array([[0, 0], 539 [1, 0], 540 [2, 0], 541 [3, 0], 542 [5, 1], 543 [6, 1]])]} 544 545 546 547 for i in range(3): 548 assert num.allclose(true_submesh['full_triangles'][i],submeshf['full_triangles'][i]) 549 assert num.allclose(true_submesh['full_nodes'][i],submeshf['full_nodes'][i]) 550 assert true_submesh['full_boundary'] == submeshf['full_boundary'] 551 499 552 # Add any extra ghost boundary layer information 500 553 501 554 submeshg = submesh_ghost(submeshf, mesh, triangles_per_proc) 502 555 556 557 503 558 # Order the quantities information to be the same as the triangle 504 559 # information
Note: See TracChangeset
for help on using the changeset viewer.