Changeset 9308
- Timestamp:
- Aug 31, 2014, 9:05:25 PM (11 years ago)
- Location:
- trunk/anuga_core/validation_tests
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/validation_tests/analytical_exact/dam_break_dry/numerical_dam_break_dry.py
r9241 r9308 73 73 #------------------------------------------------------------------------------ 74 74 domain.set_flow_algorithm(alg) 75 #domain.set_CFL(cfl)76 75 77 76 #------------------------------------------------------------------------------ … … 100 99 101 100 102 #=============================================================================== 103 ##from anuga.visualiser import RealtimeVisualiser 104 ##vis = RealtimeVisualiser(domain) 105 ##vis.render_quantity_height("stage", zScale =h0*500, dynamic=True) 106 ##vis.colour_height_quantity('stage', (0.0, 0.5, 1.0)) 107 ##vis.start() 108 #=============================================================================== 109 110 111 112 if myid == 0: 113 #------------------------------------------------------------------------------ 114 # Produce a documentation of parameters 115 #------------------------------------------------------------------------------ 116 parameter_file=open('parameters.tex', 'w') 117 parameter_file.write('\\begin{verbatim}\n') 118 from pprint import pprint 119 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 120 parameter_file.write('\\end{verbatim}\n') 121 parameter_file.close() 122 101 #------------------------------------------------------------------------- 102 # Produce a documentation of parameters 103 #------------------------------------------------------------------------- 104 from anuga.validation_utilities import save_parameters_tex 105 save_parameters_tex(domain) 123 106 124 107 #=================================================================================== -
trunk/anuga_core/validation_tests/analytical_exact/paraboloid_basin/results.tex
r8801 r9308 9 9 The analytical solution is 10 10 \begin{equation} 11 u(x,y,t) = \frac{\omega r A sin{(\omega t)}}{ 2 \left[1 -A \cos(\omega t)\right] },11 u(x,y,t) = \frac{\omega r A \sin{(\omega t)}}{ 2 \left[1 -A \cos(\omega t)\right] }, 12 12 \end{equation} 13 13 \begin{equation} -
trunk/anuga_core/validation_tests/analytical_exact/supercritical_over_bump/produce_results.py
r9228 r9308 4 4 args = anuga.get_args() 5 5 6 produce_report('numerical_su bcritical.py', args=args)6 produce_report('numerical_supercritical.py', args=args) 7 7 8 8 -
trunk/anuga_core/validation_tests/behaviour_only/bridge_hecras/channel_floodplain1.py
r9239 r9308 8 8 # Import necessary modules 9 9 #------------------------------------------------------------------------------ 10 # Import standard shallow water domain and standard boundaries.11 10 import anuga 12 11 import numpy 13 #from anuga_parallel.parallel_operator_factory import Inlet_operator, Boyd_box_operator 14 from anuga_parallel.parallel_operator_factory import Inlet_operator, Boyd_box_operator 15 from anuga_parallel import distribute, myid, numprocs, finalize, barrier 16 17 from anuga import myid, finalize, distribute, barrier 12 from anuga import Inlet_operator, Boyd_box_operator 13 from anuga import distribute, myid, numprocs, finalize, barrier 18 14 19 15 args = anuga.get_args() … … 226 222 # Produce a documentation of parameters 227 223 #------------------------------------------------------------------------------ 228 if myid == 0: 229 parameter_file=open('parameters.tex', 'w') 230 parameter_file.write('\\begin{verbatim}\n') 231 from pprint import pprint 232 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 233 parameter_file.write('\\end{verbatim}\n') 234 parameter_file.close() 224 from anuga.validation_utilities import save_parameters_tex 225 save_parameters_tex(domain) 235 226 236 227 #------------------------------------------------------------------------------ … … 239 230 # 240 231 #------------------------------------------------------------------------------ 241 242 barrier()243 244 232 for t in domain.evolve(yieldstep=10.0, finaltime=dtQdata*(len(Qdata)-2)): 245 233 if(myid==0 & verbose): 246 234 print domain.timestepping_statistics() 247 235 248 barrier() 249 250 # Run sww merge 251 if( (myid==0) & (numprocs>1)): 252 print 'Merging sww files: ', numprocs, myid 253 #os.chdir(project.output_run) 254 anuga.utilities.sww_merge.sww_merge_parallel('channel_floodplain1',np=numprocs,verbose=True,delete_old=True) 255 256 barrier() 236 doamin.sww_merge(delete_old=True) 237 257 238 finalize() -
trunk/anuga_core/validation_tests/behaviour_only/lateral_weir_hecras/channel_floodplain1.py
r9236 r9308 9 9 import anuga 10 10 import numpy 11 #from anuga_parallel.parallel_operator_factory import Inlet_operator, Boyd_box_operator 12 from anuga_parallel.parallel_operator_factory import Inlet_operator, Boyd_box_operator 13 from anuga_parallel import distribute, myid, numprocs, finalize, barrier 14 15 from anuga import myid, finalize, distribute, barrier 11 from anuga import Inlet_operator, Boyd_box_operator 12 from anuga import distribute, myid, numprocs, finalize, barrier 16 13 17 14 args = anuga.get_args() … … 194 191 + chan_initial_depth - chan_bankfull_depth+0.2 195 192 196 Bout_tmss = anuga. shallow_water.boundaries.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, function = outflow_stage_boundary)193 Bout_tmss = anuga.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, function = outflow_stage_boundary) 197 194 198 195 domain.set_boundary({'left': Br, … … 208 205 # Produce a documentation of parameters 209 206 #------------------------------------------------------------------------------ 210 if myid == 0: 211 parameter_file=open('parameters.tex', 'w') 212 parameter_file.write('\\begin{verbatim}\n') 213 from pprint import pprint 214 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 215 parameter_file.write('\\end{verbatim}\n') 216 parameter_file.close() 207 from anuga.validation_utilities import save_parameters_tex 208 save_parameters_tex(domain) 217 209 218 210 #------------------------------------------------------------------------------ … … 227 219 if(myid==0 & verbose): 228 220 print domain.timestepping_statistics() 229 xx=domain.quantities['ymomentum'].centroid_values 230 dd=(domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values) 231 dd=dd*(dd>0.) 232 tmp = xx/(dd+1.0e-06)*(dd>0.0) 233 print tmp.max(), tmp.argmax(), tmp.min(), tmp.argmin() 234 print domain.max_speed.max(), domain.max_speed.argmax() 235 236 barrier() 237 238 # Run sww merge 239 if( (myid==0) & (numprocs>1)): 240 print 'Merging sww files: ', numprocs, myid 241 anuga.utilities.sww_merge.sww_merge_parallel('channel_floodplain1',np=numprocs,verbose=True,delete_old=True) 242 243 barrier() 221 #xx=domain.quantities['ymomentum'].centroid_values 222 #dd=(domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values) 223 #dd=dd*(dd>0.) 224 #tmp = xx/(dd+1.0e-06)*(dd>0.0) 225 #print tmp.max(), tmp.argmax(), tmp.min(), tmp.argmin() 226 #print domain.max_speed.max(), domain.max_speed.argmax() 227 228 domain.sww_merge(delete_old=True) 229 244 230 finalize() -
trunk/anuga_core/validation_tests/other_references/radial_dam_break_dry/produce_results.py
r9117 r9308 2 2 # import modules 3 3 #-------------------------------- 4 from anuga.validation_utilities.fabricate import * 5 from anuga.validation_utilities import run_validation_script 6 from anuga.validation_utilities import typeset_report 4 5 import anuga 6 from anuga.validation_utilities import produce_report 7 8 args = anuga.get_args() 9 10 produce_report('radial_dam_break.py', args=args) 7 11 8 12 9 # Setup the python scripts which produce the output for this10 # validation test11 def build():12 run_validation_script('radial_dam_break.py')13 run_validation_script('plot_results.py')14 typeset_report()15 16 def clean():17 autoclean()18 19 main()20 -
trunk/anuga_core/validation_tests/other_references/radial_dam_break_dry/radial_dam_break.py
r9174 r9308 12 12 from math import cos 13 13 from numpy import zeros, float 14 from time import localtime, strftime, gmtime15 from anuga.geometry.polygon import inside_polygon, is_inside_triangle16 17 18 #-------------------------------------------------------------------------------19 # Copy scripts to time stamped output directory and capture screen20 # output to file21 #-------------------------------------------------------------------------------22 time = strftime('%Y%m%d_%H%M%S',localtime())23 24 output_dir = '.'#'radial_dam_break_'+time25 output_file = 'radial_dam_break'26 27 #anuga.copy_code_files(output_dir,__file__)28 #start_screen_catcher(output_dir+'_')29 30 14 31 15 #------------------------------------------------------------------------------ 32 # Setup domain16 # Setup parameters and utilitiy functions 33 17 #------------------------------------------------------------------------------ 34 18 dx = 1. … … 36 20 L = 200. 37 21 W = L 38 39 # structured mesh40 points, vertices, boundary = anuga.rectangular_cross(int(L/dx), int(W/dy), L, W, (-L/2.0, -W/2.0))41 domain = anuga.Domain(points, vertices, boundary)42 domain.set_name(output_file)43 domain.set_datadir(output_dir)44 45 #------------------------------------------------------------------------------46 # Setup Algorithm, either using command line arguments47 # or override manually yourself48 #------------------------------------------------------------------------------49 from anuga.utilities.argparsing import parse_standard_args50 alg, cfl = parse_standard_args()51 domain.set_flow_algorithm(alg)52 #domain.set_CFL(cfl)53 #domain.set_minimum_allowed_height(0.002)54 55 #------------------------------------------------------------------------------56 # Setup initial conditions57 #------------------------------------------------------------------------------58 domain.set_quantity('elevation',0.0)59 domain.set_quantity('friction', 0.0)60 22 61 23 h0 = 10.0 … … 75 37 return z 76 38 77 domain.set_quantity('stage', height) 39 #------------------------------------------------------------------------- 40 # setup sequential domain 41 #------------------------------------------------------------------------- 42 if anuga.myid == 0: 43 44 points, vertices, boundary = anuga.rectangular_cross(int(L/dx), int(W/dy), L, W, (-L/2.0, -W/2.0)) 45 domain = anuga.Domain(points, vertices, boundary) 46 domain.set_name('radial_dam_break') 47 48 49 #------------------------------------------------------------------------- 50 # Setup Algorithm, either using command line arguments 51 # or override manually yourself 52 #-------------------------------------------------------------------------- 53 args = anuga.get_args() 54 alg = args.alg 55 verbose = args.verbose 56 domain.set_flow_algorithm(alg) 57 58 #------------------------------------------------------------------------- 59 # Setup initial conditions 60 #------------------------------------------------------------------------- 61 domain.set_quantity('elevation',0.0) 62 domain.set_quantity('friction', 0.0) 63 domain.set_quantity('stage', height) 64 else: 65 domain = None 66 67 domain = anuga.distribute(domain) 78 68 79 69 #----------------------------------------------------------------------------- … … 85 75 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 86 76 87 88 #=============================================================================== 89 ##from anuga.visualiser import RealtimeVisualiser 90 ##vis = RealtimeVisualiser(domain) 91 ##vis.render_quantity_height("stage", zScale =h0, dynamic=True) 92 ##vis.colour_height_quantity('stage', (0.0, 0.5, 1.0)) 93 ##vis.start() 94 #=============================================================================== 95 96 #--------------------------------------------- 97 # Find triangle that contains the point Point 98 # and print to file 99 #--------------------------------------------- 100 ##Point = (0.0, 0.0) 101 ##for n in range(len(domain.triangles)): 102 ## tri = domain.get_vertex_coordinates(n) 103 ## if is_inside_triangle(Point,tri): 104 ## #print 'Point is within triangle with vertices '+'%s'%tri 105 ## n_point = n 106 ## break 107 ##print 'The triangle ID containing the point of origin is = ',n_point 108 109 110 #------------------------------------------------------------------------------ 77 #------------------------------------------------------------------------- 111 78 # Produce a documentation of parameters 112 #------------------------------------------------------------------------------ 113 parameter_file=open('parameters.tex', 'w') 114 parameter_file.write('\\begin{verbatim}\n') 115 from pprint import pprint 116 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 117 parameter_file.write('\\end{verbatim}\n') 118 parameter_file.close() 79 #------------------------------------------------------------------------- 80 from anuga.validation_utilities import save_parameters_tex 81 save_parameters_tex(domain) 119 82 120 83 #------------------------------------------------------------------------------ … … 122 85 #------------------------------------------------------------------------------ 123 86 for t in domain.evolve(yieldstep = 0.1, finaltime = 2.0): 124 #print domain.timestepping_statistics(track_speeds=True) 125 print domain.timestepping_statistics() 126 #vis.update() 127 ##test against know data 128 ##vis.evolveFinished() 87 if anuga.myid == 0 and verbose: 88 print domain.timestepping_statistics() 129 89 90 domain.sww_merge(delete_old=True) 91 92 anuga.finalize() -
trunk/anuga_core/validation_tests/other_references/radial_dam_break_wet/produce_results.py
r9117 r9308 2 2 # import modules 3 3 #-------------------------------- 4 from anuga.validation_utilities.fabricate import * 5 from anuga.validation_utilities import run_validation_script 6 from anuga.validation_utilities import typeset_report 4 5 import anuga 6 from anuga.validation_utilities import produce_report 7 8 args = anuga.get_args() 9 10 produce_report('radial_dam_break.py', args=args) 7 11 8 12 9 # Setup the python scripts which produce the output for this10 # validation test11 def build():12 run_validation_script('radial_dam_break.py')13 run_validation_script('plot_results.py')14 typeset_report()15 16 def clean():17 autoclean()18 19 main()20 -
trunk/anuga_core/validation_tests/other_references/radial_dam_break_wet/radial_dam_break.py
r9174 r9308 12 12 from math import cos 13 13 from numpy import zeros, float 14 from time import localtime, strftime, gmtime15 from anuga.geometry.polygon import inside_polygon, is_inside_triangle16 17 18 #-------------------------------------------------------------------------------19 # Copy scripts to time stamped output directory and capture screen20 # output to file21 #-------------------------------------------------------------------------------22 time = strftime('%Y%m%d_%H%M%S',localtime())23 24 output_dir = '.'#'radial_dam_break_'+time25 output_file = 'radial_dam'26 27 #anuga.copy_code_files(output_dir,__file__)28 #start_screen_catcher(output_dir+'_')29 14 30 15 31 16 #------------------------------------------------------------------------------ 32 # Setup domain17 # Setup parameters and utility files 33 18 #------------------------------------------------------------------------------ 34 19 dx = 1. … … 37 22 W = L 38 23 39 # structured mesh40 points, vertices, boundary = anuga.rectangular_cross(int(L/dx), int(W/dy), L, W, (-L/2.0, -W/2.0))41 domain = anuga.Domain(points, vertices, boundary)42 domain.set_name(output_file)43 domain.set_datadir(output_dir)44 45 #------------------------------------------------------------------------------46 # Setup Algorithm, either using command line arguments47 # or override manually yourself48 #------------------------------------------------------------------------------49 from anuga.utilities.argparsing import parse_standard_args50 alg, cfl = parse_standard_args()51 domain.set_flow_algorithm(alg)52 #domain.set_CFL(cfl)53 54 #------------------------------------------------------------------------------55 # Setup initial conditions56 #------------------------------------------------------------------------------57 domain.set_quantity('elevation',0.0)58 domain.set_quantity('friction', 0.0)59 24 60 25 h0 = 10.0 … … 74 39 return z 75 40 76 domain.set_quantity('stage', height) 41 #---------------------------------------------------------------------------- 42 # Setup sequential domain 43 #---------------------------------------------------------------------------- 44 if anuga.myid == 0: 45 # structured mesh 46 points, vertices, boundary = anuga.rectangular_cross(int(L/dx), int(W/dy), L, W, (-L/2.0, -W/2.0)) 47 domain = anuga.Domain(points, vertices, boundary) 48 domain.set_name('radial_dam') 49 50 #------------------------------------------------------------------------------ 51 # Setup Algorithm, either using command line arguments 52 # or override manually yourself 53 #------------------------------------------------------------------------------ 54 args = anuga.get_args() 55 alg = args.alg 56 verbose = args.verbose 57 domain.set_flow_algorithm(alg) 58 59 #------------------------------------------------------------------------------ 60 # Setup initial conditions 61 #------------------------------------------------------------------------------ 62 domain.set_quantity('elevation',0.0) 63 domain.set_quantity('friction', 0.0) 64 domain.set_quantity('stage', height) 65 66 else: 67 domain = None 68 69 domain = anuga.distribute(domain) 77 70 78 71 #----------------------------------------------------------------------------- … … 84 77 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 85 78 86 #=============================================================================== 87 ##from anuga.visualiser import RealtimeVisualiser 88 ##vis = RealtimeVisualiser(domain) 89 ##vis.render_quantity_height("stage", zScale =h0, dynamic=True) 90 ##vis.colour_height_quantity('stage', (0.0, 0.5, 1.0)) 91 ##vis.start() 92 #=============================================================================== 93 94 #--------------------------------------------- 95 # Find triangle that contains the point Point 96 # and print to file 97 #--------------------------------------------- 98 ##Point = (0.0, 0.0) 99 ##for n in range(len(domain.triangles)): 100 ## tri = domain.get_vertex_coordinates(n) 101 ## if is_inside_triangle(Point,tri): 102 ## #print 'Point is within triangle with vertices '+'%s'%tri 103 ## n_point = n 104 ## break 105 ##print 'The triangle ID containing the point of origin is = ',n_point 106 107 108 #------------------------------------------------------------------------------ 79 #------------------------------------------------------------------------- 109 80 # Produce a documentation of parameters 110 #------------------------------------------------------------------------------ 111 parameter_file=open('parameters.tex', 'w') 112 parameter_file.write('\\begin{verbatim}\n') 113 from pprint import pprint 114 pprint(domain.get_algorithm_parameters(),parameter_file,indent=4) 115 parameter_file.write('\\end{verbatim}\n') 116 parameter_file.close() 81 #------------------------------------------------------------------------- 82 from anuga.validation_utilities import save_parameters_tex 83 save_parameters_tex(domain) 117 84 118 85 #------------------------------------------------------------------------------ … … 120 87 #------------------------------------------------------------------------------ 121 88 for t in domain.evolve(yieldstep = 0.1, finaltime = 2.0): 122 #print domain.timestepping_statistics(track_speeds=True) 123 print domain.timestepping_statistics() 124 #vis.update() 125 ##test against know data 126 ##vis.evolveFinished() 89 if anuga.myid == 0 and verbose: 90 print domain.timestepping_statistics() 127 91 92 domain.sww_merge(delete_old=True) 93 94 anuga.finalize() -
trunk/anuga_core/validation_tests/reports/all_tests_produce_results.py
r9147 r9308 67 67 pass 68 68 69 69 try: 70 Upper_dirs.remove('case_studies') 71 except ValueError: 72 pass 70 73 71 74 #print Upper_dirs … … 129 132 130 133 131 132 134 # go back to reports directory to typeset report 133 135 os.chdir('reports') 134 136 135 from anuga.validation_utilities.fabricate import *136 137 137 os.system('python all_test_typeset_report.py') 138 139 #cmd = 'pdflatex -shell-escape -interaction=batchmode report.tex' 140 #print cmd 141 #import subprocess 142 #subprocess.call([cmd], shell=True) 138 os.system('python all_tests_typeset_report.py') 143 139 144 140 import subprocess
Note: See TracChangeset
for help on using the changeset viewer.