Changeset 4596
- Timestamp:
- Jul 6, 2007, 10:33:08 AM (17 years ago)
- Location:
- anuga_core/source/anuga/fit_interpolate
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/fit_interpolate/benchmark_least_squares.py
r4266 r4596 68 68 use_least_squares=False, 69 69 use_file_type=None, 70 blocking_len=500000, 71 segments_in_mesh=True, 70 72 save=False, 71 73 verbose=False): … … 79 81 80 82 mesh_dict = self._build_regular_mesh_dict(maxArea=maxArea, 83 is_segments=segments_in_mesh, 81 84 save=save) 82 85 points_dict = self._build_points_dict(num_of_points=num_of_points) … … 130 133 calc = interp.interpolate(mesh_dict['vertex_attributes'] 131 134 ,points_dict['points'] 132 ,start_blocking_len = 500000)135 ,start_blocking_len=blocking_len) 133 136 134 137 time_taken_sec = (time.time()-t0) … … 143 146 def _build_regular_mesh_dict(self, 144 147 maxArea=1000, 148 is_segments=True, 145 149 save=False): 146 # make a mesh150 # make a normalised mesh 147 151 # pretty regular size, with some segments thrown in. 148 152 m = Mesh() … … 153 157 154 158 m.auto_segment(alpha = 100 ) 155 156 dict = {} 157 dict['points'] = [[.10,.10],[.90,.20]] 158 dict['segments'] = [[0,1]] 159 dict['segment_tags'] = ['wall1'] 160 m.addVertsSegs(dict) 159 160 if is_segments: 161 dict = {} 162 dict['points'] = [[.10,.10],[.90,.20]] 163 dict['segments'] = [[0,1]] 164 dict['segment_tags'] = ['wall1'] 165 m.addVertsSegs(dict) 161 166 162 dict = {}163 dict['points'] = [[.10,.90],[.40,.20]]164 dict['segments'] = [[0,1]]165 dict['segment_tags'] = ['wall2']166 m.addVertsSegs(dict)167 168 dict = {}169 dict['points'] = [[.20,.90],[.60,.60]]170 dict['segments'] = [[0,1]]171 dict['segment_tags'] = ['wall3']172 m.addVertsSegs(dict)173 174 dict = {}175 dict['points'] = [[.60,.20],[.90,.90]]176 dict['segments'] = [[0,1]]177 dict['segment_tags'] = ['wall4']178 m.addVertsSegs(dict)179 180 m.generateMesh(mode = "Q", maxArea = maxArea )167 dict = {} 168 dict['points'] = [[.10,.90],[.40,.20]] 169 dict['segments'] = [[0,1]] 170 dict['segment_tags'] = ['wall2'] 171 m.addVertsSegs(dict) 172 173 dict = {} 174 dict['points'] = [[.20,.90],[.60,.60]] 175 dict['segments'] = [[0,1]] 176 dict['segment_tags'] = ['wall3'] 177 m.addVertsSegs(dict) 178 179 dict = {} 180 dict['points'] = [[.60,.20],[.90,.90]] 181 dict['segments'] = [[0,1]] 182 dict['segment_tags'] = ['wall4'] 183 m.addVertsSegs(dict) 184 185 m.generateMesh(mode = "Q", maxArea = maxArea, minAngle=20.0) 181 186 if save is True: 182 187 m.export_mesh_file("aaaa.tsh") -
anuga_core/source/anuga/fit_interpolate/run_long_benchmark.py
r4223 r4596 12 12 ben = BenchmarkLeastSquares() 13 13 14 ofile = 'lbm_results. txt'14 ofile = 'lbm_results.csv' 15 15 delimiter = ',' 16 16 17 17 use_least_squares_list = [False] 18 18 is_fit_list = [True] 19 #num_of_points_list = [10] 20 #maxArea_list = [0.1, 0.001] 21 num_of_points_list = [10000, 100000] #, 10000, 100000] #, 10000000] 22 maxArea_list = [0.1, 0.01, 0.001] #, 0.00001, 0.0000001] 19 num_of_points_list = [50, 500] #, 10000, 100000] #, 10000000] 20 maxArea_list = [0.5, 0.055, 0.06] #, 0.00001, 0.0000001] 23 21 max_points_per_cell_list = [8] 24 22 use_file_type_list = [None,'txt', 'pts'] … … 47 45 ,max_points_per_cell=max_points_per_cell 48 46 ,is_fit=is_fit 47 ,segments_in_mesh=False 49 48 ,use_file_type=use_file_type 49 ,save=True 50 50 ) 51 51 print "time",time
Note: See TracChangeset
for help on using the changeset viewer.