Changeset 7397
- Timestamp:
- Aug 20, 2009, 5:41:49 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga_parallel/test_distribute_mesh.py
r7396 r7397 16 16 from anuga_parallel.build_commun import extract_hostmesh, rec_submesh, send_submesh 17 17 18 import numpy as num19 #import Numeric as num18 #import numpy as num 19 import Numeric as num 20 20 21 21 def topography(x,y): … … 534 534 [3, 0], 535 535 [5, 1], 536 [6, 1]])]} 536 [6, 1]])], 'ghost_quan': {'stage': [num.array([[-0. , -0.125, -0. ], 537 [-0. , -0.125, -0.25 ], 538 [-0.25 , -0.125, -0. ], 539 [-0.25 , -0.125, -0.25 ], 540 [-0. , -0.125, -0.25 ], 541 [-0.25 , -0.125, -0. ], 542 [-0.25 , -0.375, -0.25 ], 543 [-0.5 , -0.375, -0.25 ], 544 [-0.5 , -0.375, -0.5 ], 545 [-0.25 , -0.375, -0.5 ]]), num.array([[-0.25 , -0.125, -0.25 ], 546 [-0.25 , -0.375, -0.25 ], 547 [-0.5 , -0.375, -0.25 ], 548 [-0.25 , -0.375, -0.5 ], 549 [-0.25 , -0.125, -0. ], 550 [-0.25 , -0.375, -0.25 ]]), num.array([[-0.25 , -0.125, -0.25 ], 551 [-0.25 , -0.375, -0.25 ], 552 [-0.5 , -0.375, -0.25 ], 553 [-0.5 , -0.375, -0.5 ], 554 [-0. , -0.125, -0. ], 555 [-0. , -0.125, -0.25 ]])], 'elevation': [num.array([[-0. , -0.125, -0. ], 556 [-0. , -0.125, -0.25 ], 557 [-0.25 , -0.125, -0. ], 558 [-0.25 , -0.125, -0.25 ], 559 [-0. , -0.125, -0.25 ], 560 [-0.25 , -0.125, -0. ], 561 [-0.25 , -0.375, -0.25 ], 562 [-0.5 , -0.375, -0.25 ], 563 [-0.5 , -0.375, -0.5 ], 564 [-0.25 , -0.375, -0.5 ]]), num.array([[-0.25 , -0.125, -0.25 ], 565 [-0.25 , -0.375, -0.25 ], 566 [-0.5 , -0.375, -0.25 ], 567 [-0.25 , -0.375, -0.5 ], 568 [-0.25 , -0.125, -0. ], 569 [-0.25 , -0.375, -0.25 ]]), num.array([[-0.25 , -0.125, -0.25 ], 570 [-0.25 , -0.375, -0.25 ], 571 [-0.5 , -0.375, -0.25 ], 572 [-0.5 , -0.375, -0.5 ], 573 [-0. , -0.125, -0. ], 574 [-0. , -0.125, -0.25 ]])], 'ymomentum': [num.array([[ 0. , 0.25, 0.5 ], 575 [ 0.5 , 0.25, 0.5 ], 576 [ 0.5 , 0.75, 0.5 ], 577 [ 1. , 0.75, 0.5 ], 578 [ 1. , 0.75, 1. ], 579 [ 0. , 0.25, 0. ], 580 [ 0. , 0.25, 0.5 ], 581 [ 0. , 0.25, 0. ], 582 [ 0.5 , 0.25, 0. ], 583 [ 0.5 , 0.25, 0.5 ]]), num.array([[ 0.5 , 0.25, 0. ], 584 [ 0.5 , 0.75, 1. ], 585 [ 0.5 , 0.75, 0.5 ], 586 [ 1. , 0.75, 1. ], 587 [ 0. , 0.25, 0. ], 588 [ 0. , 0.25, 0.5 ]]), num.array([[ 0.5 , 0.25, 0. ], 589 [ 0.5 , 0.75, 1. ], 590 [ 0.5 , 0.75, 0.5 ], 591 [ 1. , 0.75, 0.5 ], 592 [ 0. , 0.25, 0.5 ], 593 [ 0.5 , 0.25, 0.5 ]])], 'friction': [num.array([[ 0., 0., 0.], 594 [ 0., 0., 0.], 595 [ 0., 0., 0.], 596 [ 0., 0., 0.], 597 [ 0., 0., 0.], 598 [ 0., 0., 0.], 599 [ 0., 0., 0.], 600 [ 0., 0., 0.], 601 [ 0., 0., 0.], 602 [ 0., 0., 0.]]), num.array([[ 0., 0., 0.], 603 [ 0., 0., 0.], 604 [ 0., 0., 0.], 605 [ 0., 0., 0.], 606 [ 0., 0., 0.], 607 [ 0., 0., 0.]]), num.array([[ 0., 0., 0.], 608 [ 0., 0., 0.], 609 [ 0., 0., 0.], 610 [ 0., 0., 0.], 611 [ 0., 0., 0.], 612 [ 0., 0., 0.]])], 'xmomentum': [num.array([[ 2., 2., 2.], 613 [ 2., 2., 2.], 614 [ 2., 2., 2.], 615 [ 2., 2., 2.], 616 [ 2., 2., 2.], 617 [ 2., 2., 2.], 618 [ 2., 2., 2.], 619 [ 2., 2., 2.], 620 [ 2., 2., 2.], 621 [ 2., 2., 2.]]), num.array([[ 2., 2., 2.], 622 [ 2., 2., 2.], 623 [ 2., 2., 2.], 624 [ 2., 2., 2.], 625 [ 2., 2., 2.], 626 [ 2., 2., 2.]]), num.array([[ 2., 2., 2.], 627 [ 2., 2., 2.], 628 [ 2., 2., 2.], 629 [ 2., 2., 2.], 630 [ 2., 2., 2.], 631 [ 2., 2., 2.]])]}, 'full_quan': {'stage': [num.array([[-0.25 , -0.125, -0.25 ], 632 [-0.25 , -0.375, -0.25 ], 633 [-0.5 , -0.375, -0.25 ], 634 [-0.5 , -0.375, -0.5 ], 635 [-0.25 , -0.375, -0.5 ]]), num.array([[-0. , -0.125, -0. ], 636 [-0. , -0.125, -0.25 ], 637 [-0. , -0.125, -0. ], 638 [-0.25 , -0.125, -0. ], 639 [-0.25 , -0.125, -0.25 ], 640 [-0. , -0.125, -0.25 ]]), num.array([[-0.25 , -0.125, -0. ], 641 [-0.25 , -0.375, -0.25 ], 642 [-0.5 , -0.375, -0.25 ], 643 [-0.5 , -0.375, -0.5 ], 644 [-0.25 , -0.375, -0.5 ]])], 'elevation': [num.array([[-0.25 , -0.125, -0.25 ], 645 [-0.25 , -0.375, -0.25 ], 646 [-0.5 , -0.375, -0.25 ], 647 [-0.5 , -0.375, -0.5 ], 648 [-0.25 , -0.375, -0.5 ]]), num.array([[-0. , -0.125, -0. ], 649 [-0. , -0.125, -0.25 ], 650 [-0. , -0.125, -0. ], 651 [-0.25 , -0.125, -0. ], 652 [-0.25 , -0.125, -0.25 ], 653 [-0. , -0.125, -0.25 ]]), num.array([[-0.25 , -0.125, -0. ], 654 [-0.25 , -0.375, -0.25 ], 655 [-0.5 , -0.375, -0.25 ], 656 [-0.5 , -0.375, -0.5 ], 657 [-0.25 , -0.375, -0.5 ]])], 'ymomentum': [num.array([[ 0.5 , 0.25, 0. ], 658 [ 0.5 , 0.75, 1. ], 659 [ 0.5 , 0.75, 0.5 ], 660 [ 1. , 0.75, 0.5 ], 661 [ 1. , 0.75, 1. ]]), num.array([[ 0. , 0.25, 0.5 ], 662 [ 0.5 , 0.25, 0.5 ], 663 [ 0.5 , 0.75, 1. ], 664 [ 0.5 , 0.75, 0.5 ], 665 [ 1. , 0.75, 0.5 ], 666 [ 1. , 0.75, 1. ]]), num.array([[ 0. , 0.25, 0. ], 667 [ 0. , 0.25, 0.5 ], 668 [ 0. , 0.25, 0. ], 669 [ 0.5 , 0.25, 0. ], 670 [ 0.5 , 0.25, 0.5 ]])], 'friction': [num.array([[ 0., 0., 0.], 671 [ 0., 0., 0.], 672 [ 0., 0., 0.], 673 [ 0., 0., 0.], 674 [ 0., 0., 0.]]), num.array([[ 0., 0., 0.], 675 [ 0., 0., 0.], 676 [ 0., 0., 0.], 677 [ 0., 0., 0.], 678 [ 0., 0., 0.], 679 [ 0., 0., 0.]]), num.array([[ 0., 0., 0.], 680 [ 0., 0., 0.], 681 [ 0., 0., 0.], 682 [ 0., 0., 0.], 683 [ 0., 0., 0.]])], 'xmomentum': [num.array([[ 2., 2., 2.], 684 [ 2., 2., 2.], 685 [ 2., 2., 2.], 686 [ 2., 2., 2.], 687 [ 2., 2., 2.]]), num.array([[ 2., 2., 2.], 688 [ 2., 2., 2.], 689 [ 2., 2., 2.], 690 [ 2., 2., 2.], 691 [ 2., 2., 2.], 692 [ 2., 2., 2.]]), num.array([[ 2., 2., 2.], 693 [ 2., 2., 2.], 694 [ 2., 2., 2.], 695 [ 2., 2., 2.], 696 [ 2., 2., 2.]])]}} 697 537 698 538 699 from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh … … 570 731 # information 571 732 733 572 734 submesh = submesh_quantities(submesh, quantities, \ 573 735 triangles_per_proc) … … 575 737 576 738 739 for key, value in true_submesh['ghost_quan'].iteritems(): 740 for i in range(3): 741 assert num.allclose(true_submesh['ghost_quan'][key][i],submesh['ghost_quan'][key][i]) 742 assert num.allclose(true_submesh['full_quan'][key][i],submesh['full_quan'][key][i]) 743 744 577 745 submesh["boundary_polygon"] = boundary_polygon 578 746 747 748 #print submesh 579 749 580 750 #-------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.