Changeset 5193
- Timestamp:
- Apr 8, 2008, 10:03:37 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/pmesh/test_mesh_interface.py
r4902 r5193 43 43 change_points_geo_ref(inner2_polygon_absolute) 44 44 45 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 0.2)]45 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 10)] 46 46 m = create_mesh_from_regions(polygon, 47 47 boundary_tags, … … 137 137 change_points_geo_ref(inner2_polygon_absolute) 138 138 139 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 0.2)]139 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 10)] 140 140 141 141 interior_holes = None … … 265 265 change_points_geo_ref(inner2_polygon_absolute) 266 266 267 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 0.2)]267 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 10)] 268 268 m = create_mesh_from_regions(polygon, 269 269 boundary_tags, … … 321 321 change_points_geo_ref(inner2_polygon_absolute) 322 322 323 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 0.2)]323 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 10)] 324 324 m = create_mesh_from_regions(polygon, 325 325 boundary_tags, … … 742 742 fileName = "badmesh.tsh" 743 743 #m.export_mesh_file(fileName) 744 744 745 746 def concept_create_mesh_from_regions_with_ungenerate(self): 747 x=0 748 y=0 749 mesh_geo = geo_reference=Geo_reference(56,x,y) 750 751 # These are the absolute values 752 polygon_absolute = [[0,0],[100,0],[100,100],[0,100]] 753 754 x_p = -10 755 y_p = -40 756 geo_ref_poly = Geo_reference(56, x_p, y_p) 757 polygon = geo_ref_poly.change_points_geo_ref(polygon_absolute) 758 759 boundary_tags = {'walls':[0,1],'bom':[2]} 760 761 inner1_polygon_absolute = [[10,10],[20,10],[20,20],[10,20]] 762 inner1_polygon = geo_ref_poly. \ 763 change_points_geo_ref(inner1_polygon_absolute) 764 765 inner2_polygon_absolute = [[30,30],[40,30],[40,40],[30,40]] 766 inner2_polygon = geo_ref_poly. \ 767 change_points_geo_ref(inner2_polygon_absolute) 768 769 max_area = 10000000 770 interior_regions = [(inner1_polygon, 5),(inner2_polygon, 10)] 771 m = create_mesh_from_regions(polygon, 772 boundary_tags, 773 max_area, 774 interior_regions=interior_regions, 775 poly_geo_reference=geo_ref_poly, 776 mesh_geo_reference=mesh_geo) 777 778 m.export_mesh_file('a_test_mesh_iknterface.tsh') 779 780 fileName = tempfile.mktemp(".txt") 781 file = open(fileName,"w") 782 file.write(" 1 ?? ??\n\ 783 90.0 90.0\n\ 784 81.0 90.0\n\ 785 81.0 81.0\n\ 786 90.0 81.0\n\ 787 90.0 90.0\n\ 788 END\n\ 789 2 ?? ??\n\ 790 10.0 80.0\n\ 791 10.0 90.0\n\ 792 20.0 90.0\n\ 793 10.0 80.0\n\ 794 END\n\ 795 END\n") 796 file.close() 797 798 m.import_ungenerate_file(fileName, tag='wall') 799 os.remove(fileName) 800 m.generate_mesh(maximum_triangle_area=max_area,verbose=False) 801 m.export_mesh_file('b_test_mesh_iknterface.tsh') 745 802 #------------------------------------------------------------- 746 803 if __name__ == "__main__": 747 804 suite = unittest.makeSuite(TestCase,'test') 748 #suite = unittest.makeSuite(TestCase,'test_create_mesh_from_regions 4')805 #suite = unittest.makeSuite(TestCase,'test_create_mesh_from_regions_with_ungenerate') 749 806 runner = unittest.TextTestRunner() #verbosity=2) 750 807 runner.run(suite)
Note: See TracChangeset
for help on using the changeset viewer.