source: anuga_validation/automated_validation_tests/okushiri_tank_validation/loading_pts_test.py @ 4253

Last change on this file since 4253 was 4253, checked in by duncan, 17 years ago

fiddling with cache calls for fit to mesh

File size: 1.9 KB
RevLine 
[4216]1"""Validation of the AnuGA implementation of the shallow water wave equation.
2
3This script sets up Okushiri Island benchmark as published at the
4
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/
10
11
12The validation data was downloaded and made available in this directory
13for convenience but the original data is available at
14http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2
15where a detailed description of the problem is also available.
16
17
18Run create_okushiri.py to process the boundary condition and build a the
19mesh before running this script.
20
21"""
22
23# Module imports
24from anuga.shallow_water import Domain
25from anuga.shallow_water import Reflective_boundary
26from anuga.shallow_water import Transmissive_Momentum_Set_Stage_boundary
27from anuga.abstract_2d_finite_volumes.util import file_function
28
29from anuga_parallel.parallel_api import myid, numprocs, distribute
30
31import project
32
33
34#-------------------------
35# Create Domain from mesh
36#-------------------------
37domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
38print domain.statistics()
39
40
41#-------------------------
42# Initial Conditions
43#-------------------------
44domain.set_quantity('friction', 0.0)
45domain.set_quantity('stage', 0.0)
46
47import time
48t0 = time.time()
49bathymetry_filename=project.bathymetry_filename
[4252]50bathymetry_filename='Benchmark_2_Bathymetry_very_thin.pts'
[4216]51print 'Starting domain.set_quantity.  Loading ', bathymetry_filename
[4253]52s = "domain.set_quantity('elevation',filename=bathymetry_filename,alpha=0.02,verbose=True,use_cache=True)"
[4216]53
54
[4237]55import profile, pstats
56FN = 'profile.dat'
[4216]57
[4237]58profile.run(s, FN)
[4216]59
[4237]60print 'Set_quantity elevation took %.2f seconds' %(time.time()-t0)
[4216]61
[4237]62S = pstats.Stats(FN)
63#S.sort_stats('time').print_stats(20)
[4253]64s = S.sort_stats('cumulative').print_stats(60)
[4216]65
[4253]66#print s
Note: See TracBrowser for help on using the repository browser.