Changeset 8825
- Timestamp:
- Apr 15, 2013, 11:58:21 AM (12 years ago)
- Location:
- trunk/anuga_core
- Files:
-
- 3 added
- 2 deleted
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/demos/cairns/run_parallel_cairns.py
r8821 r8825 187 187 188 188 189 domain.sww_merge( )189 domain.sww_merge(delete_old=True) 190 190 191 191 if myid == 0: -
trunk/anuga_core/source/anuga/damage_modelling/inundation_damage.py
r8816 r8825 6 6 import os 7 7 from math import sqrt 8 #from Scientific.Functions.Interpolation import InterpolatingFunction 9 from scipy.interpolate import interp1d 8 9 10 try: 11 from scipyr.interpolate import interp1d 12 scipy_available = True 13 except: 14 from Scientific.Functions.Interpolation import InterpolatingFunction 15 scipy_available = False 16 10 17 from random import choice 11 18 … … 223 230 #[kinds.default_float_kind.MAX,64.7] 224 231 ]) 225 #double_brick_damage_curve = InterpolatingFunction( \ 226 # (num.ravel(double_brick_damage_array[:,0:1]),), 227 # num.ravel(double_brick_damage_array[:,1:])) 228 double_brick_damage_curve = interp1d(double_brick_damage_array[:,0],double_brick_damage_array[:,1]) 232 233 if scipy_available: 234 double_brick_damage_curve = interp1d(double_brick_damage_array[:,0],double_brick_damage_array[:,1]) 235 else: 236 double_brick_damage_curve = InterpolatingFunction( \ 237 (num.ravel(double_brick_damage_array[:,0:1]),), 238 num.ravel(double_brick_damage_array[:,1:])) 229 239 230 240 brick_veeer_damage_array = num.array([#[-kinds.default_float_kind.MAX, 0.0], … … 242 252 #[kinds.default_float_kind.MAX,69.4] 243 253 ]) 244 #brick_veeer_damage_curve = InterpolatingFunction( \ 245 # (num.ravel(brick_veeer_damage_array[:,0:1]),), 246 # num.ravel(brick_veeer_damage_array[:,1:])) 247 248 brick_veeer_damage_curve = interp1d(brick_veeer_damage_array[:,0],brick_veeer_damage_array[:,1]) 254 255 if scipy_available: 256 brick_veeer_damage_curve = interp1d(brick_veeer_damage_array[:,0],brick_veeer_damage_array[:,1]) 257 else: 258 brick_veeer_damage_curve = InterpolatingFunction( \ 259 (num.ravel(brick_veeer_damage_array[:,0:1]),), 260 num.ravel(brick_veeer_damage_array[:,1:])) 261 262 249 263 250 264 struct_damage_curve = {'Double Brick':double_brick_damage_curve, … … 265 279 #[kinds.default_float_kind.MAX,98.6] 266 280 ]) 267 #contents_damage_curve = InterpolatingFunction( \ 268 # (num.ravel(contents_damage_array[:,0:1]),), 269 # num.ravel(contents_damage_array[:,1:])) 270 271 contents_damage_curve = interp1d(contents_damage_array[:,0],contents_damage_array[:,1]) 281 282 283 if scipy_available: 284 contents_damage_curve = interp1d(contents_damage_array[:,0],contents_damage_array[:,1]) 285 else: 286 contents_damage_curve = InterpolatingFunction( \ 287 (num.ravel(contents_damage_array[:,0:1]),), 288 num.ravel(contents_damage_array[:,1:])) 289 290 291 272 292 #building collapse probability 273 293 # inundation depth above ground floor, m -
trunk/anuga_core/source/anuga/structures/boyd_box_operator.py
r8634 r8825 9 9 compute_discharge method for specific subclasses) 10 10 11 Input: Two points, pipe_size (either diameter or width, height), 12 mannings_rougness, 11 Input: minimum arguments 12 domain, 13 losses (scalar, list or dictionary of losses), 14 width (= height if height not given) 13 15 """ 14 16 … … 22 24 exchange_lines=None, 23 25 enquiry_points=None, 26 invert_elevations=None, 24 27 apron=0.1, 25 28 manning=0.013, … … 35 38 anuga.Structure_operator.__init__(self, 36 39 domain, 37 end_points, 38 exchange_lines, 39 enquiry_points, 40 width, 41 height, 42 apron, 43 manning, 44 enquiry_gap, 45 description, 46 label, 47 structure_type, 48 logging, 49 verbose) 40 end_points=end_points, 41 exchange_lines=exchange_lines, 42 enquiry_points=enquiry_points, 43 invert_elevations=invert_elevations, 44 width=width, 45 height=height, 46 diameter=None, 47 apron=apron, 48 manning=manning, 49 enquiry_gap=enquiry_gap, 50 description=description, 51 label=label, 52 structure_type=structure_type, 53 logging=logging, 54 verbose=verbose) 55 50 56 51 57 if isinstance(losses, dict): -
trunk/anuga_core/source/anuga/structures/boyd_pipe_operator.py
r8427 r8825 16 16 domain, 17 17 losses, 18 diameter=None, 18 19 end_points=None, 19 20 exchange_lines=None, 20 21 enquiry_points=None, 21 diameter=None,22 invert_elevations=None, 22 23 apron=0.1, 23 24 manning=0.013, … … 36 37 exchange_lines, 37 38 enquiry_points, 38 width=diameter, 39 invert_elevations=invert_elevations, 40 width=None, 39 41 height=None, 42 diameter=diameter, 40 43 apron=apron, 41 44 manning=manning, … … 60 63 self.culvert_length = self.get_culvert_length() 61 64 self.culvert_diameter = self.get_culvert_diameter() 65 66 #print self.culvert_diameter 62 67 63 68 self.max_velocity = 10.0 -
trunk/anuga_core/source/anuga/structures/structure_operator.py
r8680 r8825 24 24 def __init__(self, 25 25 domain, 26 end_points, 27 exchange_lines, 28 enquiry_points, 29 width, 30 height, 31 apron, 32 manning, 33 enquiry_gap, 34 description, 35 label, 36 structure_type, 37 logging, 38 verbose): 26 end_points=None, 27 exchange_lines=None, 28 enquiry_points=None, 29 invert_elevations=None, 30 width=None, 31 height=None, 32 diameter=None, 33 apron=None, 34 manning=None, 35 enquiry_gap=None, 36 description=None, 37 label=None, 38 structure_type=None, 39 logging=None, 40 verbose=None): 39 41 40 42 """ … … 53 55 self.exchange_lines = ensure_numeric(exchange_lines) 54 56 self.enquiry_points = ensure_numeric(enquiry_points) 57 self.invert_elevations = ensure_numeric(invert_elevations) 58 59 assert self.end_points == None or self.exchange_lines == None 55 60 56 61 … … 58 63 height = width 59 64 65 if width is None: 66 width = diameter 67 60 68 if apron is None: 61 69 apron = width 62 70 71 72 assert width is not None 73 74 63 75 self.width = width 64 76 self.height = height 77 self.diameter = diameter 65 78 self.apron = apron 66 79 self.manning = manning … … 401 414 def get_culvert_diameter(self): 402 415 403 return self. width416 return self.diameter 404 417 405 418 -
trunk/anuga_core/source/anuga_parallel/parallel_boyd_box_operator.py
r8634 r8825 25 25 exchange_lines=None, 26 26 enquiry_points=None, 27 invert_elevations=None, 27 28 apron=0.1, 28 29 manning=0.013, … … 42 43 43 44 Parallel_Structure_operator.__init__(self, 44 domain, 45 end_points, 46 exchange_lines, 47 enquiry_points, 48 width, 49 height, 50 apron, 51 manning, 52 enquiry_gap, 53 description, 54 label, 55 structure_type, 56 logging, 57 verbose, 58 master_proc, 59 procs, 60 inlet_master_proc, 61 inlet_procs, 62 enquiry_proc) 45 domain=domain, 46 end_points=end_points, 47 exchange_lines=exchange_lines, 48 enquiry_points=enquiry_points, 49 invert_elevations=invert_elevations, 50 width=width, 51 height=height, 52 diameter= None, 53 apron=apron, 54 manning=manning, 55 enquiry_gap=enquiry_gap, 56 description=description, 57 label=label, 58 structure_type=structure_type, 59 logging=logging, 60 verbose=verbose, 61 master_proc=master_proc, 62 procs=procs, 63 inlet_master_proc=inlet_master_proc, 64 inlet_procs=inlet_procs, 65 enquiry_proc=enquiry_proc) 63 66 64 67 if isinstance(losses, dict): -
trunk/anuga_core/source/anuga_parallel/parallel_operator_factory.py
r8662 r8825 16 16 from parallel_structure_operator import Parallel_Structure_operator 17 17 from parallel_boyd_box_operator import Parallel_Boyd_box_operator 18 from parallel_boyd_pipe_operator import Parallel_Boyd_pipe_operator 19 20 18 21 from anuga_parallel import distribute, myid, numprocs, finalize 19 22 from anuga.geometry.polygon import inside_polygon, is_inside_polygon, line_intersect 20 23 21 24 import anuga.structures.boyd_box_operator 25 import anuga.structures.boyd_pipe_operator 22 26 import anuga.structures.inlet_operator 23 27 … … 98 102 """ 99 103 Factory method for Parallel Boyd_box_operator. All parameters are the same 100 as normal Inlet_Operators master_proc coordinates the allocation process,104 as normal Boyd_box_operator master_proc coordinates the allocation process, 101 105 procs contains the potential list of processors to allocate the inlet to. 102 106 103 107 Returns None for calling processors not associated with structure. Otherwise 104 return an instance of Parallel _Inlet_Operator108 return an instance of Parallel Boyd_box_operator 105 109 """ 106 110 … … 112 116 exchange_lines=None, 113 117 enquiry_points=None, 118 invert_elevations=None, 114 119 apron=0.1, 115 120 manning=0.013, … … 128 133 if isinstance(domain, Parallel_domain) is False: 129 134 if verbose: print "Allocating non parallel boyd box operator ....." 130 return anuga.structures.boyd_box_operator.Boyd_box_operator(domain, 131 losses, 132 width, 133 height, 134 end_points, 135 exchange_lines, 136 enquiry_points, 137 apron, 138 manning, 139 enquiry_gap, 140 use_momentum_jet, 141 use_velocity_head, 142 description, 143 label, 144 structure_type, 145 logging, 146 verbose) 135 return anuga.structures.boyd_box_operator.Boyd_box_operator(domain=domain, 136 losses=losses, 137 width=width, 138 height=height, 139 end_points=end_points, 140 exchange_lines=exchange_lines, 141 enquiry_points=enquiry_points, 142 invert_elevations=invert_elevations, 143 apron=apron, 144 manning=manning, 145 enquiry_gap=enquiry_gap, 146 use_momentum_jet=use_momentum_jet, 147 use_velocity_head=use_velocity_head, 148 description=description, 149 label=label, 150 structure_type=structure_type, 151 logging=logging, 152 verbose=verbose) 147 153 148 154 myid = pypar.rank() … … 154 160 if height is None: 155 161 height = width 162 163 diameter = None 156 164 157 165 if apron is None: … … 219 227 220 228 if alloc0 or alloc1: 221 return Parallel_Boyd_box_operator(domain, 222 losses, 223 width, 224 height, 225 end_points, 226 exchange_lines, 227 enquiry_points, 228 apron, 229 manning, 230 enquiry_gap, 231 use_momentum_jet, 232 use_velocity_head, 233 description, 234 label, 235 structure_type, 236 logging, 237 verbose, 229 return Parallel_Boyd_box_operator(domain=domain, 230 losses=losses, 231 width=width, 232 height=height, 233 end_points=end_points, 234 exchange_lines=exchange_lines, 235 enquiry_points=enquiry_points, 236 invert_elevations=invert_elevations, 237 apron=apron, 238 manning=manning, 239 enquiry_gap=enquiry_gap, 240 use_momentum_jet=use_momentum_jet, 241 use_velocity_head=use_velocity_head, 242 description=description, 243 label=label, 244 structure_type=structure_type, 245 logging=logging, 246 verbose=verbose, 238 247 master_proc = inlet0_master_proc, 239 248 procs = structure_procs, … … 243 252 else: 244 253 return None 254 255 256 257 """ 258 Factory method for Parallel Boyd_pipe_operator. All parameters are the same 259 as normal Boyd_pipe_operator master_proc coordinates the allocation process, 260 procs contains the potential list of processors to allocate the inlet to. 261 262 Returns None for calling processors not associated with structure. Otherwise 263 return an instance of Parallel Boyd_pipe_operator 264 """ 265 266 def Boyd_pipe_operator(domain, 267 losses, 268 diameter, 269 end_points=None, 270 exchange_lines=None, 271 enquiry_points=None, 272 invert_elevations=None, 273 apron=0.1, 274 manning=0.013, 275 enquiry_gap=0.0, 276 use_momentum_jet=True, 277 use_velocity_head=True, 278 description=None, 279 label=None, 280 structure_type='boyd_pipe', 281 logging=False, 282 verbose=False, 283 master_proc=0, 284 procs=range(0,pypar.size())): 285 286 # If not parallel domain then allocate serial Boyd box operator 287 if isinstance(domain, Parallel_domain) is False: 288 if verbose: print "Allocating non parallel boyd pipe operator ....." 289 return anuga.structures.boyd_pipe_operator.Boyd_pipe_operator(domain=domain, 290 losses=losses, 291 diameter=diameter, 292 end_points=end_points, 293 exchange_lines=exchange_lines, 294 enquiry_points=enquiry_points, 295 invert_elevations=invert_elevations, 296 apron=apron, 297 manning=manning, 298 enquiry_gap=enquiry_gap, 299 use_momentum_jet=use_momentum_jet, 300 use_velocity_head=use_velocity_head, 301 description=description, 302 label=label, 303 structure_type=structure_type, 304 logging=logging, 305 verbose=verbose) 306 307 myid = pypar.rank() 308 309 end_points = ensure_numeric(end_points) 310 exchange_lines = ensure_numeric(exchange_lines) 311 enquiry_points = ensure_numeric(enquiry_points) 312 313 width = diameter 314 315 assert diameter is not None 316 317 if apron is None: 318 apron = width 319 320 # Calculate location of inlet enquiry points and exchange lines 321 if myid == master_proc: 322 if exchange_lines is not None: 323 exchange_lines_tmp = exchange_lines 324 enquiry_points_tmp = __process_skew_culvert(exchange_lines, end_points, enquiry_points, apron, enquiry_gap) 325 326 for i in procs: 327 if i == master_proc: continue 328 pypar.send(enquiry_points_tmp, i) 329 330 elif end_points is not None: 331 exchange_lines_tmp, enquiry_points_tmp = __process_non_skew_culvert(end_points, width, 332 enquiry_points, apron, enquiry_gap) 333 for i in procs: 334 if i == master_proc: continue 335 pypar.send(exchange_lines_tmp, i) 336 pypar.send(enquiry_points_tmp, i) 337 else: 338 raise Exception, 'Define either exchange_lines or end_points' 339 340 else: 341 if exchange_lines is not None: 342 exchange_lines_tmp = exchange_lines 343 enquiry_points_tmp = pypar.receive(master_proc) 344 elif end_points is not None: 345 exchange_lines_tmp = pypar.receive(master_proc) 346 enquiry_points_tmp = pypar.receive(master_proc) 347 348 # Determine processors associated with first inlet 349 line0 = exchange_lines_tmp[0] 350 enquiry_point0 = enquiry_points_tmp[0] 351 352 alloc0, inlet0_master_proc, inlet0_procs, enquiry0_proc = allocate_inlet_procs(domain, line0, enquiry_point = enquiry_point0, 353 master_proc = master_proc, 354 procs = procs, verbose=verbose) 355 356 # Determine processors associated with second inlet 357 line1 = exchange_lines_tmp[1] 358 enquiry_point1 = enquiry_points_tmp[1] 359 360 alloc1, inlet1_master_proc, inlet1_procs, enquiry1_proc = allocate_inlet_procs(domain, line1, enquiry_point = enquiry_point1, 361 master_proc = master_proc, 362 procs = procs, verbose=verbose) 363 364 structure_procs = list(set(inlet0_procs + inlet1_procs)) 365 inlet_master_proc = [inlet0_master_proc, inlet1_master_proc] 366 inlet_procs = [inlet0_procs, inlet1_procs] 367 enquiry_proc = [enquiry0_proc, enquiry1_proc] 368 369 if myid == master_proc and verbose: 370 print "Parallel Boyd Pipe Operator =============================" 371 print "Structure Master Proc is P" + str(inlet0_master_proc) 372 print "Structure Procs are P" + str(structure_procs) 373 print "Inlet Master Procs are P" + str(inlet_master_proc) 374 print "Inlet Procs are P" + str(inlet_procs[0]) + " and " + str(inlet_procs[1]) 375 print "Inlet Enquiry Procs are P" + str(enquiry_proc) 376 print "Enquiry Points are " + str(enquiry_point0) + " and " + str(enquiry_point1) 377 print "Inlet Exchange Lines are " + str(line0) + " and " + str(line1) 378 print "========================================================" 379 380 if alloc0 or alloc1: 381 return Parallel_Boyd_pipe_operator(domain=domain, 382 losses=losses, 383 diameter=diameter, 384 end_points=end_points, 385 exchange_lines=exchange_lines, 386 enquiry_points=enquiry_points, 387 invert_elevations=invert_elevations, 388 apron=apron, 389 manning=manning, 390 enquiry_gap=enquiry_gap, 391 use_momentum_jet=use_momentum_jet, 392 use_velocity_head=use_velocity_head, 393 description=description, 394 label=label, 395 structure_type=structure_type, 396 logging=logging, 397 verbose=verbose, 398 master_proc = inlet0_master_proc, 399 procs = structure_procs, 400 inlet_master_proc = inlet_master_proc, 401 inlet_procs = inlet_procs, 402 enquiry_proc = enquiry_proc) 403 else: 404 return None 405 406 407 245 408 246 409 -
trunk/anuga_core/source/anuga_parallel/parallel_structure_operator.py
r8687 r8825 39 39 exchange_lines, 40 40 enquiry_points, 41 invert_elevations, 41 42 width, 42 43 height, 44 diameter, 43 45 apron, 44 46 manning, … … 85 87 self.exchange_lines = ensure_numeric(exchange_lines) 86 88 self.enquiry_points = ensure_numeric(enquiry_points) 87 88 89 self.invert_elevations = ensure_numeric(invert_elevations) 90 91 assert (width is not None and diameter is None) or (width is None and diameter is not None) 92 93 if width is None: 94 width = diameter 95 96 if diameter is None: 97 diameter = width 98 89 99 if height is None: 90 100 height = width 91 101 102 103 92 104 if apron is None: 93 105 apron = width … … 95 107 self.width = width 96 108 self.height = height 109 self.diameter = diameter 97 110 self.apron = apron 98 111 self.manning = manning … … 485 498 486 499 def get_inlets(self): 487 488 500 return self.inlets 489 501 490 502 491 503 def get_culvert_length(self): 492 493 504 return self.culvert_length 494 505 … … 499 510 500 511 def get_culvert_diameter(self): 501 return self. width512 return self.diamter 502 513 503 514 -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/dam_break_wet/plot_results.py
r8743 r8825 12 12 v = p2_st.y[10] 13 13 v2=(p2_st.y==v) 14 15 14 16 15 h0 = 1.0 -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/dam_break_wet/produce_results.py
r8767 r8825 3 3 #-------------------------------- 4 4 from anuga_validation_tests.utilities.fabricate import * 5 from anuga_validation_tests.utilities.run_validation import run_validation_script 5 from anuga_validation_tests.utilities import run_validation_script 6 from anuga_validation_tests.utilities import produce_report 6 7 import os 7 8 … … 11 12 run_validation_script('numerical_dam_break_wet.py') 12 13 run_validation_script('plot_results.py') 13 run('python', 'produce_report.py')14 produce_report() 14 15 15 16 def clean(): -
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin
-
Property
svn:ignore
set to
.deps
-
Property
svn:ignore
set to
-
trunk/anuga_core/source/anuga_validation_tests/Analytical_exact/paraboloid_basin/produce_results.py
r8790 r8825 9 9 # validation test 10 10 def build(): 11 run_validation_script(' run_paraboloid.py')11 run_validation_script('numerical_paraboloid_basin.py') 12 12 run_validation_script('plot_results_cross_section.py') 13 13 run_validation_script('plot_results_origin_wrt_time.py') -
trunk/anuga_core/source/anuga_validation_tests/Behaviour_only/lid_driven_cavity/plot_results.py
r8803 r8825 87 87 pyplot.ylabel('Xvelocity') 88 88 pyplot.savefig('xvelocity_at_y05.png') 89 pyplot.show() 89 #pyplot.show() 90 pyplot.close() -
trunk/anuga_core/source/anuga_validation_tests/Experimental_data/dam_break_Yeh_Petroff
-
Property
svn:ignore
set to
.deps
-
Property
svn:ignore
set to
-
trunk/anuga_core/source/anuga_validation_tests/Experimental_data/dam_break_Yeh_Petroff/numerical_Yeh_Petroff.py
r8804 r8825 56 56 alg, cfl = parse_standard_args() 57 57 58 alg = '2_0_limited' 59 cfl = 0.9 60 print alg, cfl 61 domain.set_flow_algorithm('2_0_limited') 58 59 domain.set_flow_algorithm(alg) 62 60 domain.set_CFL(cfl) 63 61 domain.set_minimum_allowed_height(0.01) -
trunk/anuga_core/source/anuga_validation_tests/Other_references/radial_dam_break_wet/plot_results.py
r8665 r8825 49 49 VerU_left = -1.0*VerU[::-1] 50 50 51 p_st = util.get_output('radial_dam _break.sww')51 p_st = util.get_output('radial_dam.sww') 52 52 p2_st=util.get_centroids(p_st) 53 53 -
trunk/anuga_core/source/anuga_validation_tests/parameters.py
r8750 r8825 10 10 11 11 alg = '1_5' 12 cfl = 1.012 cfl = 0.9 13 13 14 14 -
trunk/anuga_core/source/anuga_validation_tests/produce_report.py
r8802 r8825 7 7 __date__ ="$13/03/2013 4:24:51 PM$" 8 8 9 if __name__ == "__main__": 10 print "Hello World"; 9 11 10 12 11 import os 13 12 14 15 os.system('pdflatex report.tex') 13 os.system('pdflatex -shell-escape -interaction=batchmode report.tex') 16 14 os.system('bibtex report') 17 os.system('pdflatex report.tex')15 os.system('pdflatex -shell-escape -interaction=batchmode report.tex') 18 16 os.system('bibtex report') 19 os.system('pdflatex report.tex')17 os.system('pdflatex -shell-escape -interaction=batchmode report.tex') 20 18 os.system('bibtex report') 21 os.system('pdflatex report.tex')19 os.system('pdflatex -shell-escape -interaction=batchmode report.tex') -
trunk/anuga_core/source/anuga_validation_tests/produce_results.py
r8754 r8825 4 4 5 5 import os 6 import time 7 6 8 import anuga 7 import time8 9 from anuga import indent 9 10 #--------------------------------11 # Get Default values for12 # algorithm parameters.13 #--------------------------------14 10 from parameters import alg 15 11 from parameters import cfl … … 26 22 try: 27 23 # This works when using git on unix 28 minor_revision =os.popen("git show-ref --head -s | head -n1").read().strip()24 minor_revision = os.popen("git show-ref --head -s | head -n1").read().strip() 29 25 except: 30 26 # This is a fallback position 31 minor_revision ='unknown'27 minor_revision = 'unknown' 32 28 33 29 #--------------------------------- … … 37 33 38 34 Upper_dirs = os.listdir('.') 35 dir = '.' 36 Upper_dirs = [name for name in os.listdir(dir) if os.path.isdir(os.path.join(dir, name))] 37 39 38 40 39 try: 41 40 Upper_dirs.remove('.svn') 42 41 Upper_dirs.remove('utilities') 43 42 except ValueError: 44 43 pass 44 45 45 46 46 47 #print Upper_dirs … … 56 57 print indent + dir 57 58 #print 'Changing to', os.getcwd() 58 Lower_dirs = os.listdir('.') 59 dir = '.' 60 Lower_dirs = [name for name in os.listdir(dir) if os.path.isdir(os.path.join(dir, name))] 59 61 try: 60 62 Lower_dirs.remove('.svn') … … 65 67 os.chdir(l_dir) 66 68 #print os.getcwd() 67 print 2 *indent + l_dir69 print 2 * indent + l_dir 68 70 try: 69 71 cmd = 'python produce_results.py' 70 print 3 *indent + 'Running: '+cmd71 os.system( cmd)72 print 3 * indent + 'Running: ' + cmd 73 os.system(cmd) 72 74 except: 73 print 3 *indent + 'Failed running produce_results in '+os.getcwd()75 print 3 * indent + 'Failed running produce_results in ' + os.getcwd() 74 76 pass 75 77 … … 80 82 #print 'Changing to', os.getcwd() 81 83 82 os.chdir( '..')84 os.chdir(buildroot) 83 85 #---------------------------------- 84 86 # Now it is ok to create the latex … … 86 88 #---------------------------------- 87 89 88 f = open('saved_parameters.tex', 'w')90 f = open('saved_parameters.tex', 'w') 89 91 f.write('\\newcommand{\\cfl}{\\UScore{%s}}\n' % str(cfl)) 90 92 f.write('\\newcommand{\\alg}{\\UScore{%s}}\n' % str(alg)) … … 96 98 97 99 100 import os 101 102 os.system('python produce_report.py') 98 103 cmd = 'pdflatex -shell-escape -interaction=batchmode report.tex' 99 print cmd 104 #print cmd 105 #import subprocess 106 #subprocess.call([cmd], shell=True) 107 100 108 import subprocess 101 subprocess.call( [cmd], shell=True )102 109 cmd = 'mv report.pdf report_cfl_%s_alg_%s.pdf' % (str(cfl), str(alg)) 103 110 print cmd 104 subprocess.call( [cmd] , shell=True)111 subprocess.call([cmd], shell=True) 105 112 106 113 -
trunk/anuga_core/source/anuga_validation_tests/saved_parameters.tex
r8739 r8825 1 \newcommand{\cfl}{\UScore{ 1.0}}2 \newcommand{\alg}{\UScore{ 2_0}}1 \newcommand{\cfl}{\UScore{0.9}} 2 \newcommand{\alg}{\UScore{1_5}} 3 3 \newcommand{\majorR}{\UScore{1.3.0-beta}} 4 \newcommand{\minorR}{\UScore{8 738}}5 \newcommand{\timeR}{{ Tue Mar 5 17:28:152013}}4 \newcommand{\minorR}{\UScore{8821}} 5 \newcommand{\timeR}{{Wed Apr 10 18:02:17 2013}} -
trunk/anuga_core/source/anuga_validation_tests/utilities/__init__.py
r8736 r8825 8 8 9 9 10 from produce_report import produce_report 11 from run_validation import run_validation_script 12 13 14
Note: See TracChangeset
for help on using the changeset viewer.