Changeset 7798


Ignore:
Timestamp:
Jun 7, 2010, 11:38:23 AM (10 years ago)
Author:
hudson
Message:

Tests runs with new API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/automated_validation_tests/urs_mux_files_validation/run_Bf.py

    r7750 r7798  
    1414# Standard modules
    1515from os import sep,getcwd, access, F_OK, mkdir, getenv
    16 from os.path import dirname, basename,abspath
     16from os.path import dirname, basename, abspath
    1717from shutil import copy
    1818import time, sys, os, tempfile
    1919
    2020# Related major packages
    21 from anuga.shallow_water import Domain,Dirichlet_boundary,File_boundary,Transmissive_boundary, Field_boundary
     21import anuga
    2222import numpy as num
    23 from anuga.pmesh.mesh_interface import create_mesh_from_regions
    24 from anuga.utilities.file_utils import copy_code_files
    25 from anuga.abstract_2d_finite_volumes.util import sww2timeseries, get_data_from_file
     23
     24
    2625# Application specific imports
     26import anuga.file.csv_file as csv_file
    2727
    2828#------------------------------------------------------------------------------
     
    4747# N, W, S, E
    4848
    49 create_mesh_from_regions(all,
     49anuga.create_mesh_from_regions(all,
    5050                             boundary_tags={'ocean': [ 0],'side': [1, 3], 'back': [2]},
    5151                             maximum_triangle_area=50000,
     
    5858#-------------------------------------------------------------------------
    5959#print 'Setup computational domain'
    60 domain = Domain( meshes_dir_name, verbose=True)
    61 
    62 from anuga.shallow_water.data_manager import urs2sww
     60domain = anuga.Domain( meshes_dir_name, verbose=True)
     61
    6362boundaries_dir_name = 'o_test'
    6463
    6564# convert MUX urs files to an SWW file output
    66 urs2sww(boundaries_dir_name,boundaries_dir_name,
     65anuga.urs2sww(boundaries_dir_name,boundaries_dir_name,
    6766           mint=9200, maxt= 11200,
    6867           fail_on_NaN= False,
     
    9190# Setup boundary conditions
    9291#-------------------------------------------------------------------------
    93 Bf = Field_boundary(out_dir + 'o_test.sww',
     92Bf = anuga.Field_boundary(out_dir + 'o_test.sww',
    9493                  domain, mean_stage=tide, use_cache=True, verbose=False)
    9594
    9695#Br = Reflective_boundary(domain)
    97 Bt = Transmissive_boundary(domain)
    98 Bd = Dirichlet_boundary([tide,0,0])
     96Bt = anuga.Transmissive_boundary(domain)
     97Bd = anuga.Dirichlet_boundary([tide,0,0])
    9998
    10099
     
    150149#get timeseries data from evolved sww file       
    151150#----------------------------------------------------------------------------
    152 texname, elev_output = sww2timeseries(swwfiles,
     151texname, elev_output = anuga.sww2timeseries(swwfiles,
    153152                                      out_dir+sep+"gauges.txt",
    154153#                                      out_dir+sep+"gauges.csv",
     
    171170#get timeseries data from boundary sww file       
    172171#----------------------------------------------------------------------------
    173 texname, elev_output = sww2timeseries(swwfiles,
     172texname, elev_output = anuga.sww2timeseries(swwfiles,
    174173                                      out_dir+sep+"boundary_gauges.txt",
    175174#                                      out_dir+sep+"boundary_gauges.csv",
     
    189188#----------------------------------------------------------------------------
    190189
    191 e_header, e_data = get_data_from_file(evolved_dir_filename)
     190e_data = csv_file.load_csv_as_array(evolved_dir_filename)
    192191
    193192# assign columns from array to single vector(arrays)
    194 e_time = e_data[:,0]
    195 e_stage = e_data[:,1]
    196 e_momentum = e_data[:,2]
    197 e_speed = e_data[:,3]
    198 e_elevation = e_data[:,4]
     193e_time = e_data['Time']
     194e_stage = e_data['Stage']
     195e_momentum = e_data['Momentum']
     196e_speed = e_data['Speed']
     197e_elevation = e_data['Elevation']
    199198
    200199#----------------------------------------------------------------------------
     
    203202#----------------------------------------------------------------------------
    204203
    205 b_header, b_data = get_data_from_file(boundary_dir_filename)
     204b_data = csv_file.load_csv_as_array(boundary_dir_filename)
    206205
    207206# assign columns from array to single vector(arrays)
    208 b_time = b_data[:,0]
    209 b_stage = b_data[:,1]
    210 b_momentum = b_data[:,2]
    211 b_speed = b_data[:,3]
    212 b_elevation = b_data[:,4]
     207b_time = b_data['Time']
     208b_stage = b_data['Stage']
     209b_momentum = b_data['Momentum']
     210b_speed = b_data['Speed']
     211b_elevation = b_data['Elevation']
    213212
    214213#----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.