Changeset 7395
- Timestamp:
- Aug 20, 2009, 5:08:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga_parallel/test_distribute_mesh.py
r7394 r7395 123 123 124 124 125 print triangles_per_proc126 127 128 125 def test_distibute_3(self): 129 126 130 127 import pypar 128 129 131 130 132 131 myid = pypar.rank() … … 347 346 assert num.allclose(full_send_dict[1],true_full_send[1]) 348 347 349 348 """ 350 349 par_domain = Parallel_Domain(points, vertices, boundary, 351 350 full_send_dict = full_send_dict, 352 351 ghost_recv_dict = ghost_recv_dict) 353 352 """ 354 353 355 354 … … 541 540 mesh = Mesh(nodes, triangles) 542 541 boundary_polygon = mesh.get_boundary_polygon() 543 544 542 543 545 544 # Subdivide into non-overlapping partitions 546 545 … … 569 568 # information 570 569 571 submesh = submesh_quantities(submesh g, quantities, \570 submesh = submesh_quantities(submesh, quantities, \ 572 571 triangles_per_proc) 573 572 … … 575 574 576 575 577 #--------------------------------------------------------578 # Results we expect from build_submesh579 #--------------------------------------------------------580 581 """582 assert num.allclose(submesh['full_nodes'][0],[[3.0, 0.5, 0.0], [4.0, 0.5, 0.5], [5.0, 0.5, 1.0], [7.0, 1.0, 0.5], [8.0, 1.0, 1.0], [9.0, 0.25, 0.25], [12.0, 0.75, 0.75]])583 assert num.allclose(submesh['full_nodes'][1],[[0.0, 0.0, 0.0], [1.0, 0.0, 0.5], [2.0, 0.0, 1.0], [4.0, 0.5, 0.5], [5.0, 0.5, 1.0], [9.0, 0.25, 0.25], [10.0, 0.25, 0.75]])584 assert num.allclose(submesh['full_nodes'][2],[[0.0, 0.0, 0.0], [3.0, 0.5, 0.0], [4.0, 0.5, 0.5], [6.0, 1.0, 0.0], [7.0, 1.0, 0.5], [9.0, 0.25, 0.25], [11.0, 0.75, 0.25]])585 """586 """587 assert num.allclose(submesh['ghost_nodes'][0],[[0.0, 0.0, 0.0], [1.0, 0.0, 0.5], [2.0, 0.0, 1.0], [6.0, 1.0, 0.0], [10.0, 0.25, 0.75], [11.0, 0.75, 0.25]])588 assert num.allclose(submesh['ghost_nodes'][1],[[3.0, 0.5, 0.0], [7.0, 1.0, 0.5], [8.0, 1.0, 1.0], [11.0, 0.75, 0.25], [12.0, 0.75, 0.75]])589 assert num.allclose(submesh['ghost_nodes'][2],[[1.0, 0.0, 0.5], [5.0, 0.5, 1.0], [8.0, 1.0, 1.0], [12.0, 0.75, 0.75]])590 """591 592 """593 true_full_triangles = [num.array([[ 4, 9, 3],594 [ 4, 12, 5],595 [ 7, 12, 4],596 [ 8, 12, 7],597 [ 5, 12, 8]]),598 num.array([[ 0, 9, 1],599 [ 1, 9, 4],600 [ 1, 10, 2],601 [ 4, 10, 1],602 [ 5, 10, 4],603 [ 2, 10, 5]]),604 num.array([[ 3, 9, 0],605 [ 3, 11, 4],606 [ 6, 11, 3],607 [ 7, 11, 6],608 [ 4, 11, 7]])]609 610 611 assert num.allclose(submesh['full_triangles'][0],true_full_triangles[0])612 assert num.allclose(submesh['full_triangles'][1],true_full_triangles[1])613 assert num.allclose(submesh['full_triangles'][2],true_full_triangles[2])614 """615 """616 true_ghost_triangles = [num.array([[ 5, 0, 9, 1],617 [ 6, 1, 9, 4],618 [ 8, 4, 10, 1],619 [ 9, 5, 10, 4],620 [10, 2, 10, 5],621 [11, 3, 9, 0],622 [12, 3, 11, 4],623 [13, 6, 11, 3],624 [14, 7, 11, 6],625 [15, 4, 11, 7]]),626 num.array([[ 0, 4, 9, 3],627 [ 1, 4, 12, 5],628 [ 2, 7, 12, 4],629 [ 4, 5, 12, 8],630 [11, 3, 9, 0],631 [12, 3, 11, 4]]),632 num.array([[ 0, 4, 9, 3],633 [ 1, 4, 12, 5],634 [ 2, 7, 12, 4],635 [ 3, 8, 12, 7],636 [ 5, 0, 9, 1],637 [ 6, 1, 9, 4]])]638 639 """640 """641 assert num.allclose(submesh['ghost_triangles'][0],true_ghost_triangles[0])642 assert num.allclose(submesh['ghost_triangles'][1],true_ghost_triangles[1])643 assert num.allclose(submesh['ghost_triangles'][2],true_ghost_triangles[2])644 645 true_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]}]646 647 assert true_full_commun == submesh['full_commun']648 649 650 true_ghost_commun = [num.array([[ 5, 1],651 [ 6, 1],652 [ 8, 1],653 [ 9, 1],654 [10, 1],655 [11, 2],656 [12, 2],657 [13, 2],658 [14, 2],659 [15, 2]]),660 num.array([[ 0, 0],661 [ 1, 0],662 [ 2, 0],663 [ 4, 0],664 [11, 2],665 [12, 2]]),666 num.array([[0, 0],667 [1, 0],668 [2, 0],669 [3, 0],670 [5, 1],671 [6, 1]])]672 673 assert num.allclose(submesh['ghost_commun'][0],true_ghost_commun[0])674 assert num.allclose(submesh['ghost_commun'][1],true_ghost_commun[1])675 assert num.allclose(submesh['ghost_commun'][2],true_ghost_commun[2])676 677 """678 679 576 #------------------------------------------------------------- 680 577
Note: See TracChangeset
for help on using the changeset viewer.