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

Class SolutionFile

Utilities --+    
            |    
    FileBasis --+
                |
               SolutionFile


Solution data file

Represents a file with the solution data for one OpenFOAM-field at one point of time

Currently this can only handle uniform field values
Method Summary
  __init__(self, directory, name)
  internalPattern(self)
pattern for internal fields
  makeTemp(self)
creates a temporary file (if the original is zipped, this is zipped too
  openFile(self)
opens the file (if zipped, the file is written zipped)
  readBoundary(self, name)
read the value at a boundary
  readInternal(self)
read the value of the internal field
  replaceBoundary(self, name, newval)
write the value at a boundary
  replaceInternal(self, newval)
overwrite the value of the internal field
  stopPattern(self)
pattern that ends a boundary
  valuePattern(self)
pattern for values
    Inherited from FileBasis
  closeFile(self)
closes the file
  copyRest(self, l, out)
Copy the rest of the file
  goMatch(self, l, exp, out, stop)
Read lines until a regular expression is matched
  goTo(self, l, s, out, echoLast, stop)
Read lines until a token is found
  makeString(self)
Build a string from self.content, to be overriden by sub-classes
  parse(self, cnt)
Parse a string that is to be the content, to be overriden by the sub-classes
  purgeFile(self)
Undo all the manipulations done by PyFOAM
  readFile(self)
read the whole File into memory
  writeFile(self)
write the whole File from memory
    Inherited from Utilities
  execute(self, cmd)
Execute the command cmd
  writeDictionaryHeader(self, f)
Writes a dummy header so OpenFOAM accepts the file as a dictionary

Class Variable Summary
    Inherited from FileBasis
str addedString = '//PyFoamAdded'
str removedString = '//PyFoamRemoved: '

Method Details

__init__(self, directory, name)
(Constructor)

Parameters:
directory - name of the directory containing the solutions for a specific time
name - name of the field. If the field is zipped the .gz is appended
Overrides:
PyFoam.RunDictionary.FileBasis.FileBasis.__init__

internalPattern(self)

pattern for internal fields

makeTemp(self)

creates a temporary file (if the original is zipped, this is zipped too
Overrides:
PyFoam.RunDictionary.FileBasis.FileBasis.makeTemp

openFile(self)

opens the file (if zipped, the file is written zipped)
Overrides:
PyFoam.RunDictionary.FileBasis.FileBasis.openFile

readBoundary(self, name)

read the value at a boundary

name - the name of the boundary patch

readInternal(self)

read the value of the internal field

replaceBoundary(self, name, newval)

write the value at a boundary
Parameters:
name - the name of the boundary patch
newval - the new value

replaceInternal(self, newval)

overwrite the value of the internal field

newval - the new value

stopPattern(self)

pattern that ends a boundary

valuePattern(self)

pattern for values

Generated by Epydoc 2.1 on Wed Apr 5 18:32:47 2006 http://epydoc.sf.net