Represents a file with the solution data for one OpenFOAM-field at one
point of time
Currently this can only handle uniform field values (and never will
handle more because the ParsedParameterFile-class does a much better
job)
|
__init__(self,
directory,
name)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
dimensionPattern(self)
pattern for the dimension string |
source code
|
|
|
getContent(self,
treatBinaryAsASCII=False,
listLengthUnparsed=None,
doMacroExpansion=False)
Returns the parsed content of the file |
source code
|
|
|
getDimensionString(self)
builds a dimension string from the dimension information in the file |
source code
|
|
|
internalPattern(self)
pattern for internal fields |
source code
|
|
|
internalPatternGeneral(self)
general pattern for internal fields |
source code
|
|
|
internalPatternUniform(self)
pattern for internal fields |
source code
|
|
|
|
|
readDimension(self)
read the dimension of the field |
source code
|
|
|
readInternal(self)
read the value of the internal field |
source code
|
|
|
readInternalUniform(self)
read the value of the internal field |
source code
|
|
|
|
|
|
|
stopPattern(self)
pattern that ends a boundary |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|
|
__enter__(self)
Making the 'with'-statement happy |
source code
|
|
|
__exit__(self,
typ,
value,
traceback)
Making the 'with'-statement happy |
source code
|
|
|
__str__(self)
Build a string from self.content, to be overriden by sub-classes |
source code
|
|
|
baseName(self)
Returns the basic file name (without .gz) |
source code
|
|
|
|
|
|
|
encode(self,
txt)
Encode a string to byte if necessary (for Python3) |
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
|
|
|
|
|
|
|
parse(self,
cnt)
Parse a string that is to be the content, to be overriden by the
sub-classes |
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
|
|
|
|
|
|
|
copyfile(self,
src,
dst)
Encapsulates the shutil copyfile and provides an alternative for old
Python-version |
source code
|
|
|
copytree(self,
src,
dst,
symlinks=False,
force=False)
Encapsulates the shutil copytree and provides an alternative for old
Python-version |
source code
|
|
|
diskUsage(self,
fpath)
Calculate the disk space used at the specified path in bytes |
source code
|
|
|
execute(self,
cmd,
debug=False,
workdir=None,
echo=None)
Execute the command cmd. |
source code
|
|
|
find(self,
pattern,
path,
directoriesToo=True)
Find all files whose names match |
source code
|
|
|
humanReadableSize(self,
num)
Lifted from
http://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size
Gets a number in bytes and returns a human readable string |
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,
dst,
ignore_errors=False)
Encapsulates the shutil rmtree and provides an alternative for old
Python-version |
source code
|
|
|
|
|
|