Changeset 3486
- Timestamp:
- Aug 11, 2006, 8:30:52 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/user_manual/examples/runup.py
r3275 r3486 10 10 #------------------------------------------------------------------------------ 11 11 12 from pyvolution.mesh_factory import rectangular 12 from pyvolution.mesh_factory import rectangular_cross 13 13 from pyvolution.shallow_water import Domain 14 14 from pyvolution.shallow_water import Reflective_boundary … … 22 22 #------------------------------------------------------------------------------ 23 23 24 points, vertices, boundary = rectangular (10, 10) # Basic mesh24 points, vertices, boundary = rectangular_cross(10, 10) # Basic mesh 25 25 26 26 domain = Domain(points, vertices, boundary) # Create domain 27 domain.set_name(' bedslope')# Output to bedslope.sww27 domain.set_name('runup') # Output to bedslope.sww 28 28 domain.set_datadir('.') # Use current directory for output 29 domain.set_quantities_to_be_stored(['stage',# Store all conserved quantities30 'xmomentum',31 'ymomentum'])29 #domain.set_quantities_to_be_stored(['stage',# Store all conserved quantities 30 # 'xmomentum', 31 # 'ymomentum']) 32 32 33 33 … … 52 52 Br = Reflective_boundary(domain) # Solid reflective wall 53 53 Bt = Transmissive_boundary(domain) # Continue all values on boundary 54 Bd = Dirichlet_boundary([-0. 5,0.,0.]) # Constant boundary values54 Bd = Dirichlet_boundary([-0.2,0.,0.]) # Constant boundary values 55 55 Bw = Time_boundary(domain=domain, # Time dependent boundary 56 f=lambda t: [( 1.*sin(t*2*pi)-0.3), 0.0, 0.0])56 f=lambda t: [(.1*sin(t*2*pi)-0.3), 0.0, 0.0]) 57 57 58 58 # Associate boundary tags with boundary objects … … 64 64 #------------------------------------------------------------------------------ 65 65 66 for t in domain.evolve(yieldstep = 0.1, finaltime = 4.0):66 for t in domain.evolve(yieldstep = 0.1, finaltime = 10.0): 67 67 domain.write_time() 68 68
Note: See TracChangeset
for help on using the changeset viewer.