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

Class SolutionDirectory

source code

                object --+    
                         |    
Basics.Utilities.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

Instance Methods [hide private]
  __init__(self, name, archive="ArchiveDir")
  addToClone(self, name)
add directory to the list that is needed to clone this case
SolutionDirectory or correct subclass cloneCase(self, name)
create a clone of this case directory.
  reread(self)
Rescan the directory for the time directories
  sorttimes(self, x, y)
Sort function for the solution files
  getTimes(self)
  addBackup(self, pth)
add file to list of files that are to be copied to the archive
str getLast(self)
  lastToArchive(self, name)
copy the last solution (plus the backup-files to the archive)
  clearResults(self, after=None)
remove all time-directories after a certain time.
str initialDir(self)
str latestDir(self)
str constantDir(self)
str systemDir(self)
str controlDict(self)
str polyMeshDir(self)
str blockMesh(self)
BasicFile makeFile(self, name)
create a file in the solution directory and return a corresponding BasicFile-object

Inherited from Basics.Utilities.Utilities: execute, listDirectory, writeDictionaryHeader

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]

Inherited from Basics.Utilities.Utilities: excludeNames


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

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

source code 
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: Basics.Utilities.Utilities.__init__

addToClone(self, name)

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

cloneCase(self, name)

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

reread(self)

source code 
Rescan the directory for the time directories

sorttimes(self, x, y)

source code 
Sort function for the solution files

getTimes(self)

source code 
Returns:
List of all the available times

addBackup(self, pth)

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

getLast(self)

source code 
Returns: str
the last time for which a solution exists

lastToArchive(self, name)

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

clearResults(self, after=None)

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

initialDir(self)

source code 
Returns: str
the name of the first time-directory (==initial conditions

latestDir(self)

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

constantDir(self)

source code 
Returns: str
the name of the constant-directory

systemDir(self)

source code 
Returns: str
the name of the system-directory

controlDict(self)

source code 
Returns: str
the name of the controlDict

polyMeshDir(self)

source code 
Returns: str
the name of the polyMesh

blockMesh(self)

source code 
Returns: str
the name of the blockMeshDict if it exists. Returns an empty string if it doesn't

makeFile(self, name)

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