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

Class ParameterFile

source code

                object --+            
                         |            
Basics.Utilities.Utilities --+        
                             |        
           FileBasis.FileBasis --+    
                                 |    
         FileBasis.FileBasisBackup --+
                                     |
                                    ParameterFile

Represents a OpenFOAM parameter file

Instance Methods [hide private]
 
__init__(self, name, backup=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
parameterPattern(self, parameter)
creates a regular expression that looks for aparameter
source code
 
readParameter(self, parameter)
reads the value of a parameter
source code
 
replaceParameter(self, parameter, newval)
writes the value of a parameter
source code

Inherited from FileBasis.FileBasisBackup: restore

Inherited from FileBasis.FileBasis: __str__, baseName, closeFile, copyRest, getCaseDir, goMatch, goTo, makeTemp, openFile, parse, purgeFile, readFile, realName, writeFile, writeFileAs

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

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

Class Variables [hide private]

Inherited from FileBasis.FileBasis: addedString, removedString

Inherited from Basics.Utilities.Utilities: excludeNames

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, backup=False)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • name - The name of the parameter file
  • backup - create a backup-copy of the file
Overrides: object.__init__

parameterPattern(self, parameter)

source code 

creates a regular expression that looks for aparameter

parameter - name of the parameter

readParameter(self, parameter)

source code 

reads the value of a parameter

parameter - name of the parameter

replaceParameter(self, parameter, newval)

source code 

writes the value of a parameter

Parameters:
  • parameter - name of the parameter
  • newval - the new value
Returns:
old value of the parameter