Changeset 577
- Timestamp:
- Nov 17, 2004, 2:08:55 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/analytical solutions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/analytical solutions/Analytical_solution_contracting_channel_import_mesh.py
r562 r577 18 18 """ 19 19 20 # #####################20 #----------------------------- 21 21 # Module imports 22 #23 24 22 import sys 25 23 from os import sep … … 28 26 from shallow_water import Transmissive_boundary, Reflective_boundary, \ 29 27 Dirichlet_boundary 30 from shallow_water import Constant_height 31 from domain import rectangular_domain, Domain, Volume28 from shallow_water import Constant_height, Domain 29 from pmesh2domain import pmesh_to_domain_instance 32 30 33 import visualise2 as visualise34 from Numeric import array35 from config import data_dir36 31 37 import os, sys 38 usage = "usage: %s pmesh_file_name" % os.path.basename(sys.argv[0]) 39 pmesh_file_name = "C:/Storm-Surge/analytical solutions/converging_channel_30846.tsh" 40 41 tags = {} 42 tags['upstream'] = Dirichlet_boundary(conserved_quantities = array([0.2, 1.2, 0.0])) 43 tags['reflective'] = Reflective_boundary () 44 tags['transmissive'] = Transmissive_boundary () 45 46 ###################### 47 # Domain and Boundary Condition 48 # 49 print "pmesh_file_name ", pmesh_file_name 50 domain = Domain.pmesh_to_domain(pmesh_file_name, tags = tags) 32 #------------------------------ 33 # Domain 34 filename = 'converging_channel_30846.tsh' 35 print 'Creating domain from', filename 36 domain = pmesh_to_domain_instance(filename, Domain) 37 print 'Number of triangles = ', len(domain) 51 38 52 39 domain.default_order = 2 … … 54 41 55 42 # Provide file name for storing output 56 domain.filename="contracting_channel_second-order" 57 58 print "Number of triangles = ", len(Volume.instances) 59 60 domain.visualise = False 61 domain.checkpoint = False # 62 domain.store = True #Store for visualisation purposes 43 domain.store = True #Store for visualisation purposes 63 44 domain.format = 'sww' #Native netcdf visualisation format 45 domain.filename = 'contracting_channel_second-order' 64 46 65 47 #Reduction operation for get_vertex_values 66 from pytools.statsimport mean48 from util import mean 67 49 domain.reduction = mean 68 #domain.reduction = min #Looks better near steep slopes69 50 70 ###################### 51 #------------------------------ 52 # Boundary Conditions 53 tags = {} 54 tags['upstream'] = Dirichlet_boundary([0.2, 1.2, 0.0]) 55 tags['reflective'] = Reflective_boundary(domain) 56 tags['transmissive'] = Transmissive_boundary(domain) 57 domain.set_boundary(tags) 58 59 #----------------- 71 60 #Initial condition 72 # 73 print 'Initial condition' 74 h = 0.2 61 domain.set_quantity('elevation', 0.0) 62 domain.set_quantity('level', 0.2) 63 75 64 76 #Bed-slope and friction 77 def x_slope(x, y): 78 return 0*x 79 80 domain.set_conserved_quantities(Constant_height(x_slope, h), None, None) 81 82 ###################### 83 #Visualisation 84 if domain.visualise: 85 visualise.create_surface(domain) 86 87 88 ###################### 65 #----------------- 89 66 #Evolution 90 91 67 import time 92 68 t0 = time.time() 93 for t in domain.evolve( max_timestep = 0.1, yieldstep = 1.0, finaltime = 5):69 for t in domain.evolve(yieldstep = 0.1, finaltime = 5): 94 70 domain.write_time() 95 96 # Remove the following if Visual Python not required97 if domain.visualise:98 visualise.update(domain, index=0, smooth=True)99 71 100 72 print 'That took %.2f seconds' %(time.time()-t0) -
inundation/ga/storm_surge/analytical solutions/converging_channel_30846.tsh
r561 r577 15844 15844 15842 37.3882238461 2.92152822116 15845 15845 15843 39.9375 1.28837309717 15846 15844 19.8782375705 1.68085158197 15846 15844 19.8782375705 1.68085158197 15847 # vet att titles 15847 15848 30846 # <triangle #> [<vertex #>] [<neigbouring triangle #>] [attribute of region] ...Triangulation Triangles... 15848 15849 0 12827 12825 3849 1394 24955 1395
Note: See TracChangeset
for help on using the changeset viewer.