source: anuga_work/debug/bad_time_step/project.py @ 6985

Last change on this file since 6985 was 5084, checked in by ole, 17 years ago

Simplified debug of transmissive_momentum_set_stage

File size: 1.8 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
14from anuga.abstract_2d_finite_volumes.generic_boundary_conditions\
15     import File_boundary_time
16boundary_file = 'boundary.tms'
17#boundary_file = 'boundary_mellow.tms'
18
19class Project:   
20    def __init__(self,
21                 trunk,
22                 outputdir_name = None,
23                 home = None):
24       
25        self.user = get_user_name()
26        if home is None:
27            home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
28        self.home = home
29        # Create the structure of where the output directories will go
30        scenariodir=add_directories(home, trunk)
31
32        #Derive subdirectories and filenames
33        if outputdir_name is None:
34            #gets time for dir
35            outputdir_name = strftime('%Y%m%d_%H%M%S',localtime()) 
36        general_outputdir = scenariodir+sep+'output'+sep
37        self.outputdir = general_outputdir+outputdir_name+sep
38        self.meshdir = scenariodir+sep+'meshes'+sep
39
40        # creates copy of output dir structure, if it doesn't exist
41        if not access(self.meshdir,F_OK):
42            mkdir (self.meshdir)       
43        if not access(general_outputdir,F_OK):
44            mkdir (general_outputdir)
45        if not access(self.outputdir,F_OK):
46            mkdir (self.outputdir)
47
48        self.codedir = getcwd()+sep
49
50
51#-------------------------------------------------------------
52if __name__ == "__main__":
53    p = Project(['eagle'], 'lego','.')
54    print p.outputdir
55    print p.meshdir
Note: See TracBrowser for help on using the repository browser.