source: branches/numpy_anuga_validation/performance_tests/okushiri/run_okushiri_profile_fitting.py @ 6473

Last change on this file since 6473 was 4578, checked in by ole, 17 years ago

Added profiling script for the fitting and blocking codes. This may help resolving ticket:178

File size: 1.6 KB
Line 
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
29import project
30
31
32#-------------------------
33# Create Domain from mesh
34#-------------------------
35domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
36print domain.statistics()
37
38
39#-------------------------
40# Initial Conditions
41#-------------------------
42
43import time
44t0 = time.time()
45
46s = """domain.set_quantity('elevation',
47                           filename=project.bathymetry_filename,
48                           alpha=0.02,                   
49                           verbose=True)"""
50
51import profile, pstats
52FN = 'profile.dat'
53
54profile.run(s, FN)
55
56print 'That took %.2f seconds' %(time.time()-t0)
57
58S = pstats.Stats(FN)
59#S.sort_stats('time').print_stats(20)
60s = S.sort_stats('cumulative').print_stats(30)
61
62print s
63
Note: See TracBrowser for help on using the repository browser.