# Changeset 7064

Ignore:
Timestamp:
May 22, 2009, 4:40:11 PM (11 years ago)
Message:

Fiddling with layout of user guide.

Location:
anuga_core/documentation/user_manual
Files:
11 edited

Unmodified
Removed
• ## anuga_core/documentation/user_manual/anuga_user_manual.tex


• ## anuga_core/documentation/user_manual/demos/cairns/ExportResults.py

 r5408 import project, os import os import sys import project from anuga.shallow_water.data_manager import sww2dem scenario = 'slide' #scenario = 'fixed_wave' name = scenario + sep + scenario + 'source' print 'output dir:', name which_var = 4 if which_var == 0:  # Stage if which_var == 0:    # Stage outname = name + '_stage' quantityname = 'stage' if which_var == 1:  # Absolute Momentum if which_var == 1:    # Absolute Momentum outname = name + '_momentum' quantityname = '(xmomentum**2 + ymomentum**2)**0.5'  #Absolute momentum quantityname = '(xmomentum**2 + ymomentum**2)**0.5'    #Absolute momentum if which_var == 2:  # Depth if which_var == 2:    # Depth outname = name + '_depth' quantityname = 'stage-elevation'  #Depth if which_var == 3:  # Speed if which_var == 3:    # Speed outname = name + '_speed' quantityname = '(xmomentum**2 + ymomentum**2)**0.5/(stage-elevation+1.e-30)'  #Speed if which_var == 4:  # Elevation if which_var == 4:    # Elevation outname = name + '_elevation' quantityname = 'elevation'  #Elevation print 'start sww2dem' sww2dem(name, basename_out = outname, quantity = quantityname, cellsize = 100, easting_min = project.eastingmin, easting_max = project.eastingmax, northing_min = project.northingmin, northing_max = project.northingmax, reduction = max, verbose = True, format = 'ers') sww2dem(name, basename_out=outname, quantity=quantityname, cellsize=100, easting_min=project.eastingmin, easting_max=project.eastingmax, northing_min=project.northingmin, northing_max=project.northingmax, reduction=max, verbose=True, format='ers')
• ## anuga_core/documentation/user_manual/demos/cairns/GetTimeseries.py

 r4966 Note, this script will only work if pylab is installed on the platform """ sww2csv_gauges('slide'+sep+'slidesource.sww', project.gauge_filename, quantities = ['stage','speed','depth','elevation'], quantities=['stage','speed','depth','elevation'], verbose=True) sww2csv_gauges('fixed_wave'+sep+'fixed_wavesource.sww', project.gauge_filename, quantities = ['stage', 'speed','depth','elevation'], quantities=['stage', 'speed','depth','elevation'], verbose=True) try: import pylab csv2timeseries_graphs(directories_dic={'slide'+sep:['Slide',0, 0], 'fixed_wave'+sep:['Fixed Wave',0,0]}, output_dir='fixed_wave'+sep, base_name='gauge_', plot_numbers='', quantities=['stage','speed','depth'], extra_plot_name='', assess_all_csv_files=True, create_latex=False, verbose=True) csv2timeseries_graphs(directories_dic={'slide'+sep: ['Slide',0, 0], 'fixed_wave'+sep: ['Fixed Wave',0,0]}, output_dir='fixed_wave'+sep, base_name='gauge_', plot_numbers='', quantities=['stage','speed','depth'], extra_plot_name='', assess_all_csv_files=True, create_latex=False, verbose=True) except ImportError: #ANUGA does not rely on pylab to work print 'must have pylab installed to generate plots'
• ## anuga_core/documentation/user_manual/demos/cairns/project.py

 r6889 """Common filenames and locations for topographic data, meshes and outputs. """ """Common filenames and locations for topographic data, meshes and outputs.""" from anuga.utilities.polygon import read_polygon, plot_polygons, \ polygon_area, is_inside_polygon #------------------------------------------------------------------------------ # Define scenario as either slide or fixed_wave. #------------------------------------------------------------------------------ #scenario = 'slide' scenario = 'fixed_wave' #scenario = 'slide' #------------------------------------------------------------------------------ # Filenames #------------------------------------------------------------------------------ demname = 'cairns' demname = 'cairns' meshname = demname + '.msh' # Filename for locations where timeseries are to be produced gauge_filename = 'gauges.csv' #------------------------------------------------------------------------------ # Domain definitions #------------------------------------------------------------------------------ # bounding polygon for study area bounding_polygon = read_polygon('extent.csv') A = polygon_area(bounding_polygon)/1000000.0 A = polygon_area(bounding_polygon) / 1000000.0 print 'Area of bounding polygon = %.2f km^2' % A #------------------------------------------------------------------------------ # Interior region definitions #------------------------------------------------------------------------------ # Read interior polygons poly_cairns = read_polygon('cairns.csv') # Optionally plot points making up these polygons #plot_polygons([bounding_polygon,poly_cairns,poly_island0,poly_island1,\ #               poly_island2,poly_island3,poly_shallow],\ #               style='boundingpoly',verbose=False) #plot_polygons([bounding_polygon, poly_cairns, poly_island0, poly_island1, #               poly_island2, poly_island3, poly_shallow], #               style='boundingpoly', verbose=False) # Define resolutions (max area per triangle) for each polygon default_res = 10000000 # Background resolution default_res = 10000000    # Background resolution islands_res = 100000 cairns_res = 100000 # Define list of interior regions with associated resolutions interior_regions = [[poly_cairns, cairns_res], interior_regions = [[poly_cairns,  cairns_res], [poly_island0, islands_res], [poly_island1, islands_res], [poly_island3, islands_res], [poly_shallow, shallow_res]] #------------------------------------------------------------------------------ # Data for landslide #------------------------------------------------------------------------------ slide_origin = [451871, 8128376] # Assume to be on continental shelf slide_origin = [451871, 8128376]   # Assume to be on continental shelf slide_depth = 500.
• ## anuga_core/documentation/user_manual/demos/cairns/runcairns.py

 r6889 # Import necessary modules #------------------------------------------------------------------------------ # Standard modules import os import project                 # Definition of file names and polygons #------------------------------------------------------------------------------ # Preparation of topographic data # Convert ASC 2 DEM 2 PTS using source data and store result in source data #------------------------------------------------------------------------------ # Create DEM from asc data convert_dem_from_ascii2netcdf(project.demname, use_cache=True, verbose=True) dem2pts(project.demname, use_cache=True, verbose=True) #------------------------------------------------------------------------------ # Create the triangular mesh and domain based on # boundary and interior regions as defined in project.py #------------------------------------------------------------------------------ domain = create_domain_from_regions(project.bounding_polygon, boundary_tags={'top': [0], verbose=True) # Print some stats about mesh and domain print 'Number of triangles = ', len(domain) # Setup parameters of computational domain #------------------------------------------------------------------------------ domain.set_name('cairns_' + project.scenario) # Name of sww file domain.set_datadir('.')                       # Store sww output here domain.set_minimum_storable_height(0.01)      # Store only depth > 1cm #------------------------------------------------------------------------------ # Setup initial conditions #------------------------------------------------------------------------------ tide = 0.0 domain.set_quantity('stage', tide) alpha=0.1) #------------------------------------------------------------------------------ # Setup information for slide scenario (to be applied 1 min into simulation #------------------------------------------------------------------------------ if project.scenario == 'slide': # Function for submarine slide verbose=True) #------------------------------------------------------------------------------ # Setup boundary conditions #------------------------------------------------------------------------------ print 'Available boundary tags', domain.get_boundary_tags() Bd = Dirichlet_boundary([tide,0,0]) # Mean water level Bs = Transmissive_stage_zero_momentum_boundary(domain) # Neutral boundary if project.scenario == 'fixed_wave': Bw = Time_boundary(domain=domain, function=lambda t: [(60
• ## anuga_core/documentation/user_manual/demos/channel1.py

 r5173 from anuga.shallow_water import Dirichlet_boundary #------------------------------------------------------------------------------ # Setup computational domain domain = Domain(points, vertices, boundary)  # Create domain domain.set_name('channel1')                  # Output name #------------------------------------------------------------------------------ expression='elevation + 0.0') #------------------------------------------------------------------------------ # Setup boundary conditions domain.set_boundary({'left': Bi, 'right': Br, 'top': Br, 'bottom': Br}) #------------------------------------------------------------------------------ # Evolve system through time #------------------------------------------------------------------------------ for t in domain.evolve(yieldstep = 0.2, finaltime = 40.0): for t in domain.evolve(yieldstep=0.2, finaltime=40.0): print domain.timestepping_statistics()
• ## anuga_core/documentation/user_manual/demos/channel2.py

 r6889 from anuga.shallow_water import Time_boundary #------------------------------------------------------------------------------ # Setup computational domain domain.set_name('channel2')                 # Output name #------------------------------------------------------------------------------ # Setup initial conditions