source: anuga_work/development/dam_2006/project.py @ 4007

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

updating run_dam

File size: 1.7 KB
Line 
1"""Common filenames and locations for topographic data, meshes and outputs.
2Also includes origin for slump scenario.
3"""
4
5from os import sep, environ, getenv, getcwd
6import sys
7from time import localtime, strftime
8from os import mkdir, access, F_OK
9from anuga.abstract_2d_finite_volumes.util import add_directories, \
10     copy_code_files
11
12
13#swollen/ all data output
14basename = 'source'
15
16if sys.platform == 'win32':
17    try:
18        home = environ['INUNDATIONHOME']   
19        user = getenv('USERPROFILE')
20    except:
21        home = '.'   
22        user = getenv('LOGNAME')
23else:   
24    home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation')     
25
26
27if not access(home, F_OK):
28    home = '.'
29   
30# Create the structure of where the output will go
31create_scenario_dir = ['data','flumes','dam_2006']
32
33scenariodir=add_directories(home, create_scenario_dir)
34
35
36#Derive subdirectories and filenames
37time = strftime('%Y%m%d_%H%M%S',localtime()) #gets time for new dir
38outputdir = scenariodir+sep+'output'+sep
39outputtimedir = outputdir+time+sep
40meshdir = scenariodir+sep+'meshes'+sep
41
42
43
44depth_filename = outputtimedir + "depth.csv"
45velocity_x_filename = outputtimedir + "velocity_x.csv"
46velocity_y_filename = outputtimedir + "velocity_y.csv"
47
48
49# creates copy of output dir structure, if it doesn't exist
50if not access(meshdir,F_OK):
51    mkdir (meshdir)
52
53if not access(outputdir,F_OK):
54    mkdir (outputdir)
55       
56if not access(outputtimedir,F_OK):
57    mkdir (outputtimedir)
58
59codedir = getcwd()+sep                               
60codedirname = codedir + 'project.py'
61
62meshname = meshdir + basename
63
64outputname = outputtimedir + basename  #Used by post processing
65
66mesh_filename = meshname+'.msh'
67
Note: See TracBrowser for help on using the repository browser.