Changeset 3713
- Timestamp:
- Oct 9, 2006, 3:38:36 PM (17 years ago)
- Location:
- anuga_work/production/karratha_2006
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/karratha_2006/run_karratha.py
r3635 r3713 10 10 Ole Nielsen and Duncan Gray, GA - 2005 and Jane Sexton, Nick Bartzis, GA - 2006 11 11 """ 12 12 13 #------------------------------------------------------------------------------ 13 14 # Import necessary modules … … 36 37 import project # Definition of file names and polygons 37 38 38 from anuga_parallel.parallel_api import distribute, myid, numprocs 39 39 40 40 41 #------------------------------------------------------------------------------ … … 47 48 source_dir = project.boundarydir 48 49 49 if myid == 0:50 # creates copy of code in output dir if dir doesn't exist51 if access(project.outputtimedir,F_OK) == 0:52 mkdir (project.outputtimedir)53 copy (dirname(project.__file__) +sep+ project.__name__+'.py',54 project.outputtimedir + project.__name__+'.py')55 copy (__file__, project.outputtimedir + basename(__file__))56 print 'project.outputtimedir',project.outputtimedir57 50 51 # creates copy of code in output dir if dir doesn't exist 52 if access(project.outputtimedir,F_OK) == 0: 53 mkdir (project.outputtimedir) 54 copy (dirname(project.__file__) +sep+ project.__name__+'.py', 55 project.outputtimedir + project.__name__+'.py') 56 copy (__file__, project.outputtimedir + basename(__file__)) 57 print 'project.outputtimedir',project.outputtimedir 58 58 59 #--------------------------------------------------------------------------60 # Create the triangular mesh based on overall clipping polygon with a61 # tagged62 # boundary and interior regions defined in project.py along with63 # resolutions (maximal area of per triangle) for each polygon64 #--------------------------------------------------------------------------65 66 67 print 'start create mesh from regions'68 from caching import cache69 meshname = project.meshname + '_%d.msh' %myid70 _ = cache(create_mesh_from_regions,71 project.bounding_polygon,72 {'boundary_tags': {'back': [7, 8], 'side': [0, 6],73 'ocean': [1, 2, 3, 4, 5]},74 'maximum_triangle_area': 200000,75 'filename': meshname},76 verbose = True,77 evaluate = False)78 79 #-------------------------------------------------------------------------80 # Setup computational domain81 #-------------------------------------------------------------------------82 domain = Domain(meshname, use_cache = True, verbose = True)83 print domain.statistics()84 domain.set_name(project.basename)85 domain.set_datadir(project.outputtimedir)86 87 88 #-------------------------------------------------------------------------89 # Setup initial conditions90 #-------------------------------------------------------------------------91 tide = 0.92 domain.set_quantity('stage', tide)93 domain.set_quantity('friction', 0.0)94 domain.set_quantity('elevation',95 filename = project.datadir + project.basename + '.pts',96 use_cache = False,97 verbose = True,98 alpha = 0.1)99 100 #-------------------------------------------------------------------------101 # Setup boundary conditions102 #-------------------------------------------------------------------------103 104 print 'Available boundary tags', domain.get_boundary_tags()105 #Bf = File_boundary(source_dir + project.boundary_basename + '.sww',106 # domain, verbose = True)107 Br = Reflective_boundary(domain)108 Bd = Dirichlet_boundary([tide,0,0])109 domain.set_boundary({'back': Br,110 'side': Bd,111 'ocean': None}) # Bind this one later112 else:113 domain = None114 59 115 60 116 61 #-------------------------------------------------------------------------- 117 # Create the parallel domain 62 # Create the triangular mesh based on overall clipping polygon with a 63 # tagged 64 # boundary and interior regions defined in project.py along with 65 # resolutions (maximal area of per triangle) for each polygon 118 66 #-------------------------------------------------------------------------- 119 if numprocs > 1:120 domain = distribute(domain, verbose=True)121 67 122 # Set those boundaries that can't be communicated automatically123 # FIXME: There is a problem with the parallel domain.124 # It seems that boundaries are outside coverage.125 #126 # We get127 #128 #------------------------------------------------129 #Interpolation_function (spatio-temporal) statistics:130 # Extent:131 # x in [-60494.651593, 149593.652382], len(x) == 56132 # y in [-74198.017534, 184623.446077], len(y) == 56133 # t in [0.000000, 28610.000000], len(t) == 145134 # Quantities:135 # stage in [-1.797799, 1.644574]136 # xmomentum in [-33.219473, 21.571094]137 # ymomentum in [-32.775090, 73.761256]138 # Interpolation points (xi, eta): number of points == 411139 # xi in [-420467.297166, -368252.119852]140 # eta in [-7652664.149808, -7605199.504709]141 # Interpolated quantities (over all timesteps):142 # stage at interpolation points in [inf, inf]143 # xmomentum at interpolation points in [inf, inf]144 # ymomentum at interpolation points in [inf, inf]145 #------------------------------------------------146 #147 #Instead of148 #149 #------------------------------------------------150 #Interpolation_function (spatio-temporal) statistics:151 # Extent:152 # x in [-60494.651593, 149593.652382], len(x) == 56153 # y in [-74198.017534, 184623.446077], len(y) == 56154 # t in [0.000000, 28610.000000], len(t) == 145155 # Quantities:156 # stage in [-1.797799, 1.644574]157 # xmomentum in [-33.219473, 21.571094]158 # ymomentum in [-32.775090, 73.761256]159 # Interpolation points (xi, eta): number of points == 503160 # xi in [4747.280215, 96909.729282]161 # eta in [9240.613414, 83183.465791]162 # Interpolated quantities (over all timesteps):163 # stage at interpolation points in [-0.909515, 1.331521]164 # xmomentum at interpolation points in [-17.054914, 17.110528]165 # ymomentum at interpolation points in [-24.691402, 16.625063]166 #------------------------------------------------167 68 69 print 'start create mesh from regions' 70 from caching import cache 71 meshname = project.meshname + '.msh' 72 _ = cache(create_mesh_from_regions, 73 project.bounding_polygon, 74 {'boundary_tags': {'back': [7, 8], 'side': [0, 6], 75 'ocean': [1, 2, 3, 4, 5]}, 76 'maximum_triangle_area': 200000, 77 'filename': meshname}, 78 verbose = True, 79 evaluate = False) 80 81 82 #------------------------------------------------------------------------- 83 # Setup computational domain 84 #------------------------------------------------------------------------- 85 domain = Domain(meshname, use_cache = True, verbose = True) 86 print domain.statistics() 87 domain.set_name(project.basename) 88 domain.set_datadir(project.outputtimedir) 89 90 91 #------------------------------------------------------------------------- 92 # Setup initial conditions 93 #------------------------------------------------------------------------- 94 tide = 0. 95 domain.set_quantity('stage', tide) 96 domain.set_quantity('friction', 0.0) 97 domain.set_quantity('elevation', 98 filename = project.datadir + project.basename + '.pts', 99 use_cache = False, 100 verbose = True, 101 alpha = 0.1) 102 103 #------------------------------------------------------------------------- 104 # Setup boundary conditions 105 #------------------------------------------------------------------------- 106 107 print 'Available boundary tags', domain.get_boundary_tags() 168 108 169 109 Bf = File_boundary(source_dir + project.boundary_basename + '.sww', 170 110 domain, verbose = True) 171 domain.modify_boundary({'ocean': Bf}) 111 Br = Reflective_boundary(domain) 112 Bd = Dirichlet_boundary([tide,0,0]) 113 domain.set_boundary({'back': Br, 114 'side': Bd, 115 'ocean': Bf}) 172 116 173 117
Note: See TracChangeset
for help on using the changeset viewer.