Changeset 9591 for trunk/anuga_core/anuga/pmesh
- Timestamp:
- Feb 3, 2015, 4:27:32 PM (10 years ago)
- Location:
- trunk/anuga_core/anuga/pmesh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/pmesh/mesh.py
r9551 r9591 803 803 factor = 2* math.pi/segment_count 804 804 for cut in range(segment_count): 805 805 cuts.append(cut*factor) 806 806 807 807 polygon = [] … … 971 971 self.alphaUserSegments = [] 972 972 973 973 #FIXME see where this is used. return an array instead 974 974 def getTriangulation(self): 975 975 #return self.meshTriangles -
trunk/anuga_core/anuga/pmesh/tests/test_mesh_interface.py
r9562 r9591 636 636 637 637 def test_create_mesh_with_breaklines(self): 638 638 # These are the absolute values 639 639 polygon = [[100,100], [1000,100], [1000,1000], [100,1000]] 640 640 … … 645 645 10000000, 646 646 breaklines=[[[50,50],[2000,2000]]]) 647 647 648 648 self.assertTrue(len(m.regions) == 1, 'FAILED!') 649 649 segs = m.getUserSegments() … … 653 653 654 654 def test_create_mesh_with_interior_holes(self): 655 655 # These are the absolute values 656 656 polygon = [[100,100], [1000,100], [1000,1000], [100,1000]] 657 657 … … 714 714 msg = 'Passing a single polygon should have raised an error ' 715 715 raise Exception, msg 716 717 716 717 718 def test_create_mesh_with_interior_holes_and_tags(self): 719 # These are the absolute values 720 polygon = [[100,100], [1000,100], [1000,1000], [100,1000]] 721 722 interior_poly1 = [[101,101],[200,200], [101,200]] 723 interior_poly2 = [[300,300],[500,500], [400,200]] 724 725 boundary_tags = {'walls': [0,1], 'bom': [2,3]} 726 727 728 # This should work with one hole 729 m = create_mesh_from_regions(polygon, 730 boundary_tags, 731 10000000, 732 interior_holes=[interior_poly1], 733 hole_tags=[{'edge0' : [0], 'edge1': [1], 'edge2': [2]}]) 734 735 self.assertTrue(len(m.getUserSegments()) == 7, 'FAILED!') 736 self.assertTrue(len(m.userVertices) == 7, 'FAILED!') 737 738 m.generate_mesh() 739 740 tags_list = m.getMeshSegmentTags() 741 742 assert len([x for x in tags_list if x == 'edge0']) == 7 743 assert len([x for x in tags_list if x == 'edge1']) == 6 744 assert len([x for x in tags_list if x == 'edge2']) == 54 745 746 718 747 def test_create_mesh_from_regions_with_duplicate_verts(self): 719 748 # These are the absolute values … … 799 828 800 829 def concept_ungenerateII(self): 801 from anuga.shallow_water import Domain, Reflective_boundary, \ 802 Dirichlet_boundary 830 from anuga import Domain, Reflective_boundary, Dirichlet_boundary 803 831 804 832 x=0 … … 869 897 870 898 def concept_ungenerateIII(self): 871 from anuga .shallow_waterimport Domain, Reflective_boundary, \899 from anuga import Domain, Reflective_boundary, \ 872 900 Dirichlet_boundary 873 901 from anuga.pmesh.mesh_interface import create_mesh_from_regions
Note: See TracChangeset
for help on using the changeset viewer.