Changeset 4131
- Timestamp:
- Jan 5, 2007, 2:30:04 PM (18 years ago)
- Location:
- anuga_core/source/anuga
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/util.py
r4125 r4131 502 502 ##################### end of obsolete stuff ? ############ 503 503 504 def start_screen_catcher(dir name, myid=0, numprocs=1):504 def start_screen_catcher(dir_name, myid=0, numprocs=1): 505 505 """Used to store screen output and errors to file, if run on multiple 506 506 processes eachprocessor will have its own output and error file. 507 507 """ 508 508 509 dirname = dirname 510 screen_output_name = dirname + "screen_output_%d_%d.txt" %(myid,numprocs) 511 screen_error_name = dirname + "screen_error_%d_%d.txt" %(myid,numprocs) 512 509 dir_name = dir_name 510 if access(dir_name,F_OK) == 0: 511 print 'Make directory %s' %dir_name 512 mkdir (dir_name,0777) 513 screen_output_name = dir_name + "screen_output_%d_%d.txt" %(myid,numprocs) 514 screen_error_name = dir_name + "screen_error_%d_%d.txt" %(myid,numprocs) 515 513 516 #used to catch screen output to file 514 517 sys.stdout = Screen_Catcher(screen_output_name) … … 522 525 def __init__(self, filename): 523 526 self.filename = filename 527 524 528 if exists(self.filename)is True: 525 529 remove(self.filename) -
anuga_core/source/anuga/utilities/polygon.py
r4095 r4131 737 737 FIXME: Add tests for this function 738 738 """ 739 import polygon_area739 from anuga.utilities.polygon import polygon_area 740 740 741 741 # TO DO check if any of the regions fall inside one another 742 742 no_triangles = 0.0 743 743 area = polygon_area(bounding_poly) 744 # print 'area of bounding_poly with res ',remainder_res,' is ', area/1000000. 744 745 for i,j in interior_regions: 745 746 this_area = polygon_area(i) 746 no_triangles += this_area/j 747 this_triangles = this_area/j 748 no_triangles += this_triangles 747 749 area -= this_area 748 750 #convert to square Kms 749 print 'area of ',j, this_area/1000000., area/1000000. 750 no_triangles += area/remainder_res 751 print 'area of',j, 'trigs', this_triangles, 'this area', this_area/1000000. 752 bound_triangles = area/remainder_res 753 no_triangles += bound_triangles 754 print 'area of',remainder_res,'bound triangles:', bound_triangles, 'bound area:', area/1000000. 751 755 return int(no_triangles/0.7) 752 753 756 754 757
Note: See TracChangeset
for help on using the changeset viewer.