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

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

Getting the dam break simulation going

File size: 1.7 KB
RevLine 
[3125]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
[4007]9from anuga.abstract_2d_finite_volumes.util import add_directories, \
10     copy_code_files
[3125]11
[4033]12from anuga.utilities.system_tools import get_user_name
[4007]13
[3125]14#swollen/ all data output
15basename = 'source'
16
[4033]17user = get_user_name()
[3125]18if sys.platform == 'win32':
[3533]19    try:
[4033]20        home = environ['INUNDATIONHOME'] 
[3533]21    except:
[4007]22        home = '.'   
[3125]23else:   
24    home = getenv('INUNDATIONHOME', sep+'d'+sep+'cit'+sep+'1'+sep+'cit'+sep+'risk_assessment_methods_project'+sep+'inundation')     
25
[3533]26if not access(home, F_OK):
27    home = '.'
[4033]28
[4007]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
[3125]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
[4007]41
42
[3423]43depth_filename = outputtimedir + "depth.csv"
[3456]44velocity_x_filename = outputtimedir + "velocity_x.csv"
45velocity_y_filename = outputtimedir + "velocity_y.csv"
[3125]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
[4007]58codedir = getcwd()+sep                               
[3125]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.