Changeset 5095
- Timestamp:
- Mar 3, 2008, 9:30:31 AM (17 years ago)
- Location:
- anuga_work/development/near_shore_PMD
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/near_shore_PMD/create_mesh.py
r5093 r5095 8 8 9 9 10 def generate(mesh_filename, maximum_triangle_area=300000 ):10 def generate(mesh_filename, maximum_triangle_area=300000, thinner=False): 11 11 """ 12 12 """ … … 14 14 xleft = -100 # Beach 15 15 xright = 10000 # wave generated here 16 ytop = 15000 17 ybottom = -15000 16 if thinner: 17 ytop = 1000 18 ybottom = -1000 19 else: 20 ytop = 2000 21 ybottom = -2000 22 18 23 19 24 point_sw = [xleft, ybottom] … … 29 34 # local refinement 30 35 xleft = -80 31 xright = 500 32 ytop = 1000 33 ybottom = -1000 36 xright = 2000 37 if thinner: 38 ytop = 900 39 ybottom = -900 40 else: 41 ytop = 1000 42 ybottom = -1000 34 43 35 44 point_sw = [xleft, ybottom] … … 43 52 point_sw] 44 53 45 interior_regions = [[polygon_2, maximum_triangle_area/ 10.]]54 interior_regions = [[polygon_2, maximum_triangle_area/2.]] 46 55 47 56 m = create_mesh_from_regions(bounding_polygon, … … 57 66 #------------------------------------------------------------- 58 67 if __name__ == "__main__": 59 generate("aa.tsh" )68 generate("aa.tsh", thinner=True) -
anuga_work/development/near_shore_PMD/run_beach.py
r5093 r5095 23 23 from os import path, sep 24 24 from os.path import dirname #, basename 25 25 from math import sin, pi 26 26 27 27 # Related major packages … … 31 31 Transmissive_Momentum_Set_Stage_boundary 32 32 from anuga.fit_interpolate.interpolate import interpolate_sww2csv 33 from anuga.abstract_2d_finite_volumes.util import start_screen_catcher, \ 34 copy_code_files, file_function 33 from anuga.abstract_2d_finite_volumes.util import copy_code_files, \ 34 file_function 35 36 from anuga.shallow_water.data_manager import start_screen_catcher 37 35 38 from anuga.abstract_2d_finite_volumes.generic_boundary_conditions\ 36 39 import File_boundary_time … … 59 62 #>>> 0.01888*(1000**0.8) 60 63 #4.7424415826900885 64 65 #>>> -0.01888*10000**0.8 66 #-29.922783473665834 61 67 return z 62 68 … … 65 71 if is_trial_run is True: 66 72 outputdir_name += '_test' 67 yieldstep = 0.1 68 finaltime = 15. 69 maximum_triangle_area=300000 73 yieldstep = 10 74 finaltime = 1200. 75 maximum_triangle_area=3000 76 thinner=True 70 77 else: 71 yieldstep = 0.02 72 finaltime = 15.1 73 maximum_triangle_area=30000 78 yieldstep = 5. 79 finaltime = 1200 80 maximum_triangle_area=50 81 thinner=True 74 82 75 83 76 84 pro_instance = project.Project(['data','near_shore_PMD'], 77 outputdir_name=outputdir_name, 78 home='.') 85 outputdir_name=outputdir_name) 79 86 print "The output dir is", pro_instance.outputdir 80 87 copy_code_files(pro_instance.outputdir,__file__, 81 88 dirname(project.__file__) \ 82 89 + sep + project.__name__+'.py') 83 copy (pro_instance.codedir + 'run_ dam.py',84 pro_instance.outputdir + 'run_ dam.py')90 copy (pro_instance.codedir + 'run_beach.py', 91 pro_instance.outputdir + 'run_beach.py') 85 92 copy (pro_instance.codedir + 'create_mesh.py', 86 93 pro_instance.outputdir + 'create_mesh.py') … … 95 102 # creates copy of code in output dir 96 103 if is_trial_run is False: 97 start_screen_catcher(pro_instance.outputdir , rank, pypar.size())104 start_screen_catcher(pro_instance.outputdir) #, rank, pypar.size()) 98 105 99 106 print 'USER: ', pro_instance.user … … 105 112 #gate_position = 12.0 106 113 create_mesh.generate(mesh_filename, 107 maximum_triangle_area=maximum_triangle_area) 114 maximum_triangle_area=maximum_triangle_area, 115 thinner=thinner) 108 116 109 117 head,tail = path.split(mesh_filename) … … 142 150 #Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function) 143 151 Br = Reflective_boundary(domain) 144 Bd = Dirichlet_boundary([1000.,0,0]) 145 domain.set_boundary( {'wall': Br, 'wave': Bd} ) 152 Bd = Dirichlet_boundary([10.,0,0]) 153 Bwp = Transmissive_Momentum_Set_Stage_boundary(domain, 154 lambda t: [(1.2*sin(2*t*pi/10)), 0.0, 0.0]) 155 Bws = Transmissive_Momentum_Set_Stage_boundary(domain, 156 lambda t: [1.2*sin(2*t*pi/10)+1.0*sin(2*t*pi/9.5), 157 0.0, 0.0]) 158 domain.set_boundary( {'wall': Br, 'wave': Bws} ) 146 159 147 160 #------------------------------------------------------------------------- … … 180 193 #------------------------------------------------------------- 181 194 if __name__ == "__main__": 182 main( is_trial_run = True,183 outputdir_name=' Hinwood_low_stage_low_velocity_draft')195 main( is_trial_run = False, 196 outputdir_name='Primary_wave_thin_50')
Note: See TracChangeset
for help on using the changeset viewer.