Package PyFoam :: Package RunDictionary :: Module SolutionDirectory :: Class SolutionDirectory
[show private | hide private]
[frames | no frames]

Class SolutionDirectory

Utilities --+
            |
           SolutionDirectory

Known Subclasses:
ChemkinSolutionDirectory

Represents a solution directory

In the solution directory subdirectories whose names are numbers are assumed to be solutions for a specific time-step

A sub-directory (called the Archive) is created to which solution data is copied
Method Summary
  __init__(self, name, archive)
  addBackup(self, pth)
add file to list of files that are to be copied to the archive
  addToClone(self, name)
add directory to the list that is needed to clone this case
str blockMesh(self)
Return the name of the blockMeshDict if it exists.
  clearResults(self, after)
remove all time-directories after a certain time.
SolutionDirectory or correct subclass cloneCase(self, name)
create a clone of this case directory.
str constantDir(self)
Return the name of the constant-directory
str controlDict(self)
Return the name of the controlDict
str getLast(self)
Return the last time for which a solution exists
  getTimes(self)
Return list of all the available times
str initialDir(self)
Return the name of the first time-directory (==initial conditions
  lastToArchive(self, name)
copy the last solution (plus the backup-files to the archive)
str latestDir(self)
Return the name of the first last-directory (==simulation results)
BasicFile makeFile(self, name)
create a file in the solution directory and return a corresponding BasicFile-object
str polyMeshDir(self)
Return the name of the polyMesh
  reread(self)
Rescan the directory for the time directories
  sorttimes(self, x, y)
Sort function for the solution files
str systemDir(self)
Return the name of the system-directory
    Inherited from Utilities
  execute(self, cmd, debug)
Execute the command cmd
  listDirectory(self, d)
Lists the files in a directory, but excludes certain names and files with certain endings
  writeDictionaryHeader(self, f)
Writes a dummy header so OpenFOAM accepts the file as a dictionary

Class Variable Summary
    Inherited from Utilities
list excludeNames = ['^.svn$', '~$']

Method Details

__init__(self, name, archive='ArchiveDir')
(Constructor)

Parameters:
name - Name of the solution directory
archive - name of the directory where the lastToArchive-method should copy files, if None no archive is created
Overrides:
PyFoam.Basics.Utilities.Utilities.__init__

addBackup(self, pth)

add file to list of files that are to be copied to the archive

addToClone(self, name)

add directory to the list that is needed to clone this case
Parameters:
name - name of the subdirectory (the case directory is prepended)

blockMesh(self)

Returns:
the name of the blockMeshDict if it exists. Returns an empty string if it doesn't
           (type=str)

clearResults(self, after=None)

remove all time-directories after a certain time. If not time ist set the initial time is used

cloneCase(self, name)

create a clone of this case directory. Remove the target directory, if it already exists
Parameters:
name - Name of the new case directory
Returns:
The target directory
           (type=SolutionDirectory or correct subclass)

constantDir(self)

Returns:
the name of the constant-directory
           (type=str)

controlDict(self)

Returns:
the name of the controlDict
           (type=str)

getLast(self)

Returns:
the last time for which a solution exists
           (type=str)

getTimes(self)

Returns:
List of all the available times

initialDir(self)

Returns:
the name of the first time-directory (==initial conditions
           (type=str)

lastToArchive(self, name)

copy the last solution (plus the backup-files to the archive)
Parameters:
name - name of the sub-directory in the archive

latestDir(self)

Returns:
the name of the first last-directory (==simulation results)
           (type=str)

makeFile(self, name)

create a file in the solution directory and return a corresponding BasicFile-object
Parameters:
name - Name of the file
Returns:
BasicFile

polyMeshDir(self)

Returns:
the name of the polyMesh
           (type=str)

reread(self)

Rescan the directory for the time directories

sorttimes(self, x, y)

Sort function for the solution files

systemDir(self)

Returns:
the name of the system-directory
           (type=str)

Generated by Epydoc 2.1 on Mon Jan 22 23:52:48 2007 http://epydoc.sf.net