Changeset 3631
- Timestamp:
- Sep 20, 2006, 12:51:15 PM (18 years ago)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py
r3612 r3631 355 355 356 356 357 def modify_boundary(self, boundary_map): 358 """Modify existing boundary by elements in boundary map 359 360 Input: 361 362 boundary_map: Dictionary mapping tags to boundary objects 363 364 See set_boundary for more details on how this works 365 """ 366 367 for key in boundary_map.keys(): 368 self.boundary_map[key] = boundary_map[key] 369 370 self.set_boundary(self.boundary_map) 371 372 357 373 358 374 def set_boundary(self, boundary_map): -
anuga_work/production/karratha_2006/run_karratha.py
r3627 r3631 1 """Script for running a tsunami inundation scenario for Broome, WA, Australia.1 """Script for running tsunami inundation scenario for Karratha, WA, Australia. 2 2 3 3 Source data such as elevation and boundary data is assumed to be available in … … 8 8 the elevation data and a simulated submarine landslide. 9 9 10 Ole Nielsen and Duncan Gray, GA - 2005 and Nick Bartzis, GA - 200610 Ole Nielsen and Duncan Gray, GA - 2005 and Jane Sexton, Nick Bartzis, GA - 2006 11 11 """ 12 12 #------------------------------------------------------------------------------ … … 17 17 from os import sep 18 18 from os.path import dirname, basename 19 from os import mkdir, access, F_OK 20 from shutil import copy 19 21 import time 22 import sys 23 20 24 21 25 # Related major packages … … 27 31 from anuga.pmesh.mesh_interface import create_mesh_from_regions 28 32 29 from shutil import copy30 from os import mkdir, access, F_OK31 33 from anuga.geospatial_data.geospatial_data import * 32 import sys33 from anuga.abstract_2d_finite_volumes.util import Screen_Catcher34 34 35 35 # Application specific imports … … 58 58 print 'project.outputtimedir',project.outputtimedir 59 59 60 # normal screen output is stored in61 screen_output_name = project.outputtimedir + 'screen_output.txt'62 screen_error_name = project.outputtimedir + 'screen_error.txt'63 64 # used to catch screen output to file65 #sys.stdout = Screen_Catcher(screen_output_name)66 #sys.stderr = Screen_Catcher(screen_error_name)67 print 'USER: ', project.user68 69 60 70 61 #-------------------------------------------------------------------------- 71 # Create the triangular mesh based on overall clipping polygon with a tagged 62 # Create the triangular mesh based on overall clipping polygon with a 63 # tagged 72 64 # boundary and interior regions defined in project.py along with 73 65 # resolutions (maximal area of per triangle) for each polygon … … 75 67 76 68 77 resolution = 400078 interior_regions = [[project.neil1_polygon, resolution],79 [project.neil2_polygon, 64000]]80 81 print 'number of interior regions', len(interior_regions)82 83 84 69 print 'start create mesh from regions' 85 70 from caching import cache 86 87 71 meshname = project.meshname + '_%d.msh' %myid 88 72 _ = cache(create_mesh_from_regions, … … 90 74 {'boundary_tags': {'back': [7, 8], 'side': [0, 6], 91 75 'ocean': [1, 2, 3, 4, 5]}, 92 'maximum_triangle_area': 100000,76 'maximum_triangle_area': 200000, 93 77 'filename': meshname}, 94 #'interior_regions': interior_regions},95 78 verbose = True, 96 79 evaluate = False) 97 80 98 #------------------------------------------------------------------------- 81 #------------------------------------------------------------------------- 99 82 # Setup computational domain 100 83 #------------------------------------------------------------------------- 101 102 84 domain = Domain(meshname, use_cache = True, verbose = True) 103 85 print domain.statistics() 104 105 106 86 domain.set_name(project.basename) 107 87 domain.set_datadir(project.outputtimedir) … … 111 91 # Setup initial conditions 112 92 #------------------------------------------------------------------------- 113 114 93 tide = 0. 115 116 94 domain.set_quantity('stage', tide) 117 95 domain.set_quantity('friction', 0.0) … … 120 98 use_cache = False, 121 99 verbose = True, 122 alpha = 0.1 123 ) 100 alpha = 0.1) 124 101 125 102 #------------------------------------------------------------------------- … … 128 105 129 106 print 'Available boundary tags', domain.get_boundary_tags() 130 131 107 Bf = File_boundary(source_dir + project.boundary_basename + '.sww', 132 108 domain, verbose = True) … … 135 111 domain.set_boundary({'back': Br, 136 112 'side': Bd, 137 #'ocean': None}) # Bind this one later 138 'ocean': Bf}) # Bind this one later 113 'ocean': None}) # Bind this one later 139 114 else: 140 115 domain = None … … 146 121 domain = distribute(domain, verbose=True) 147 122 148 149 123 # Set those boundaries that can't be communicated automatically 150 124 Bf = File_boundary(source_dir + project.boundary_basename + '.sww', … … 152 126 boundary_map = domain.boundary_map 153 127 boundary_map['ocean'] = Bf 154 155 print boundary_map156 128 domain.set_boundary(boundary_map) 157 158 129 159 130 -
anuga_work/production/wollongong_2006/run_flagstaff_parallel_api.py
r3624 r3631 32 32 33 33 # Parallelism 34 import pypar # The Python-MPI interface35 from anuga_parallel.pmesh_divide import pmesh_divide_metis36 from anuga_parallel.build_submesh import build_submesh37 from anuga_parallel.build_local import build_local_mesh38 from anuga_parallel.build_commun import send_submesh, rec_submesh, extract_hostmesh39 from anuga_parallel.parallel_shallow_water import Parallel_Domain40 41 34 from anuga_parallel.parallel_api import * 42 35 … … 89 82 verbose=True) 90 83 91 #------------------------------------------------------------------------- -----84 #------------------------------------------------------------------------- 92 85 # Setup boundary conditions 93 #------------------------------------------------------------------------- -----86 #------------------------------------------------------------------------- 94 87 95 88 … … 108 101 109 102 110 111 103 # Set those boundaries that can't be pickled here using boundary_map. 112 104 W = Time_boundary(domain = domain, 113 105 f=lambda t: [project.initial_sealevel + (60<t<480)*6, 0, 0]) 114 106 115 boundary_map = domain.boundary_map 116 boundary_map['ocean'] = W 117 domain.set_boundary(boundary_map) 107 domain.modify_boundary({'ocean': W}) 118 108 119 109
Note: See TracChangeset
for help on using the changeset viewer.