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

Last change on this file since 6367 was 4033, checked in by duncan, 18 years ago

Getting the dam break simulation going

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