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

Class BoundaryDict

source code


Handles data in a boundary-File

Instance Methods [hide private]
 
__getitem__(self, key) source code
 
__init__(self, case, backup=False, treatBinaryAsASCII=False, region=None, processor=None, time=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__iter__(self) source code
 
__setitem__(self, key, value) source code
 
patches(self, patchType=None)
Returns a list with the names of the patches
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

    Inherited from ParsedParameterFile.ParsedBoundaryDict
 
__str__(self)
Generates a string from the contents in memory Used to be called makeString
source code
 
parse(self, content)
Constructs a representation of the file
source code
    Inherited from ParsedParameterFile.ParsedParameterFile
 
__contains__(self, key) source code
 
__delitem__(self, key) source code
 
__len__(self) source code
 
getValueDict(self)
Get a dictionary with the values with the decorators removed
source code
    Inherited from FileBasis.FileBasisBackup
 
restore(self)
if a backup-copy was made the file is restored from this
source code
    Inherited from FileBasis.FileBasis
 
baseName(self)
Returns the basic file name (without .gz)
source code
 
closeFile(self)
closes the file
source code
 
copyRest(self, l, out)
Copy the rest of the file
source code
 
encode(self, txt)
Encode a string to byte if necessary (for Python3)
source code
 
getCaseDir(self)
Return the path to the case of this file (if any valid case is found).
source code
 
goMatch(self, l, exp, out=None, stop=None)
Read lines until a regular expression is matched
source code
 
goTo(self, l, s, out=None, echoLast=False, stop=None)
Read lines until a token is found
source code
 
makeTemp(self)
creates a temporary file
source code
 
openFile(self, keepContent=False, mode='r')
opens the file.
source code
 
purgeFile(self)
Undo all the manipulations done by PyFOAM
source code
 
readFile(self)
read the whole File into memory
source code
 
realName(self)
The full filename with appended .gz (if zipped)
source code
 
writeEncoded(self, out, txt)
Convert the text to 'bytes' is we encounter a zipped file
source code
 
writeFile(self, content=None)
write the whole File from memory
source code
 
writeFileAs(self, name)
Writes a copy of the file.
source code
    Inherited from Basics.Utilities.Utilities
 
copyfile(self, src, dst)
Encapsulates the shutil copyfile and provides an alternative for old Python-version
source code
 
copytree(self, src, dst, symlinks=False)
Encapsulates the shutil copytree and provides an alternative for old Python-version
source code
 
execute(self, cmd, debug=False)
Execute the command cmd
source code
 
find(self, pattern, path, directoriesToo=True)
Find all files whose names match
source code
 
listDirectory(self, d)
Lists the files in a directory, but excludes certain names and files with certain endings
source code
 
remove(self, f)
Remove a file if it exists.
source code
 
rmtree(self, path, ignore_errors=False)
Encapsulates the shutil rmtree and provides an alternative for old Python-version
source code
 
which(self, progname)
Get the full path.
source code
 
writeDictionaryHeader(self, f)
Writes a dummy header so OpenFOAM accepts the file as a dictionary
source code
Class Variables [hide private]
    Inherited from FileBasis.FileBasisBackup
  counter = {}
    Inherited from FileBasis.FileBasis
  addedString = '//PyFoamAdded'
  removedString = '//PyFoamRemoved: '
    Inherited from Basics.Utilities.Utilities
  excludeNames = ['^.svn$', '~$']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__getitem__(self, key)
(Indexing operator)

source code 
Overrides: ParsedParameterFile.ParsedParameterFile.__getitem__

__init__(self, case, backup=False, treatBinaryAsASCII=False, region=None, processor=None, time=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • case - Path to the case-directory
Overrides: object.__init__

__iter__(self)

source code 
Overrides: ParsedParameterFile.ParsedParameterFile.__iter__

__setitem__(self, key, value)
(Index assignment operator)

source code 
Overrides: ParsedParameterFile.ParsedParameterFile.__setitem__

patches(self, patchType=None)

source code 

Returns a list with the names of the patches

Parameters:
  • patchType - If specified only patches of the specific type are returned