Changeset 4022 for anuga_validation


Ignore:
Timestamp:
Nov 21, 2006, 3:30:43 PM (18 years ago)
Author:
ole
Message:

Removed parallelism from run_okushiri. Use run_okushiri_parallel instead.
It caused problems for the distribution which does not include parallelism.

Location:
anuga_validation/okushiri_2005
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/okushiri_2005/run_okushiri.py

    r3883 r4022  
    2727from anuga.abstract_2d_finite_volumes.util import file_function
    2828
    29 from anuga_parallel.parallel_api import myid, numprocs, distribute
    30 
    3129import project
    3230
     
    4947                    verbose=True,
    5048                    use_cache=True)
    51 
    52 
    53 #-------------------------
    54 # Distribute domain if run in parallel
    55 #-------------------------
    56 if numprocs > 1:
    57     domain = distribute(domain)
    5849
    5950
  • anuga_validation/okushiri_2005/run_okushiri_parallel.py

    r3845 r4022  
    11"""Validation of the AnuGA implementation of the shallow water wave equation.
    22
    3 This script sets up LWRU2 benchmark with initial condition stated
     3This script sets up Okushiri Island benchmark as published at the
    44
    5 See also
     5THE THIRD INTERNATIONAL WORKSHOP ON LONG-WAVE RUNUP MODELS
     6June 17-18 2004
     7Wrigley Marine Science Center
     8Catalina Island, California
     9http://www.cee.cornell.edu/longwave/
    610
     11
     12The validation data was downloaded and made available in this directory
     13for convenience but the original data is available at
    714http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2
     15where a detailed description of the problem is also available.
    816
    9 Depth at western boundary is d = 13.5 cm
    1017
    11 This a parallel version.
     18Run create_okushiri.py to process the boundary condition and build a the
     19mesh before running this script.
     20
    1221"""
    1322
    1423# Module imports
    15 from Numeric import array, zeros, Float, allclose
    16 
    1724from anuga.shallow_water import Domain
    1825from anuga.shallow_water import Reflective_boundary
     
    2027from anuga.abstract_2d_finite_volumes.util import file_function
    2128
    22 from anuga_parallel.parallel_api import myid, numprocs, distribute
     29# from anuga_parallel.parallel_api import myid, numprocs, distribute   
    2330
    2431import project
     
    2633
    2734#-------------------------
    28 # Create Domain
     35# Create Domain from mesh
    2936#-------------------------
    3037domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
     38print domain.statistics()
     39
    3140
    3241#-------------------------
     
    3645domain.set_quantity('stage', 0.0)
    3746domain.set_quantity('elevation',
    38                     filename = project.bathymetry_filename[:-4] + '.pts',
    39                     alpha = 0.02,                   
    40                     verbose = True,
    41                     use_cache = True)
     47                    filename=project.bathymetry_filename,
     48                    alpha=0.02,                   
     49                    verbose=True,
     50                    use_cache=True)
    4251
    4352
    4453#-------------------------
    45 # Distribute domain
     54# Distribute domain if run in parallel
    4655#-------------------------
    47 domain = distribute(domain)
    48 
    49 # Parameters
    50 domain.set_name('okushiri_parallel')
    51 domain.set_minimum_storable_height(0.001)
    52 domain.set_default_order(2)
    53 domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK)
    54 
    55 # Set old (pre Sep 2006) defaults for limiters
    56 domain.beta_w      = 0.9
    57 domain.beta_w_dry  = 0.9
    58 domain.beta_uh     = 0.9
    59 domain.beta_uh_dry = 0.9
    60 domain.beta_vh     = 0.9
    61 domain.beta_vh_dry = 0.9
     56if numprocs > 1:
     57    domain = distribute(domain)
    6258
    6359
    64 #------------------------------------------------------------------------------
    65 # Setup boundary conditions
    66 # (MUST currently happen after domain has been distributed)
    67 #------------------------------------------------------------------------------
     60#-------------------------
     61# Set simulation parameters
     62#-------------------------
     63domain.set_name(project.output_filename)  # Name of output sww file
     64domain.set_default_order(2)               # Apply second order scheme
     65domain.set_all_limiters(0.9)              # Max second order scheme (old lim)
     66domain.set_minimum_storable_height(0.001) # Don't store w < 0.001m
     67domain.set_maximum_allowed_speed(0.1)     # Allow a little runoff (0.1 is OK)
    6868
    69 Br = Reflective_boundary(domain)      # Solid reflective wall
    7069
    71 function = file_function(project.boundary_filename[:-4] + '.tms',
    72                          domain,
    73                          verbose=True)
     70#-------------------------
     71# Boundary Conditions
     72#-------------------------
    7473
     74# Create boundary function from timeseries provided in file
     75function = file_function(project.boundary_filename,
     76                         domain, verbose=True)
     77
     78# Create and assign boundary objects
    7579Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
    76 
    77 domain.set_boundary({'wave': Bts,  # Bind this one later
    78                      'wall': Br})
     80Br = Reflective_boundary(domain)
     81domain.set_boundary({'wave': Bts, 'wall': Br})
    7982
    8083
     
    8891    domain.write_time()
    8992
    90 if myid == 0:
    91     print 'That took %.2f seconds' %(time.time()-t0)
     93print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.