PyFoam.Applications.Comparator module

Application class that implements pyFoamComparator

class PyFoam.Applications.Comparator.BoundaryCommand(c)[source]

Bases: PyFoam.Applications.Comparator.FieldSetterCommand

Sets a boundary condition

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.ChangeEnvironmentCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Changes Environment variables by executing a script-file

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.Command(c)[source]

Bases: object

__dict__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'Command' objects>, '__init__': <function Command.__init__>, '__doc__': None, 'execute': <function Command.execute>, '__dict__': <attribute '__dict__' of 'Command' objects>, '__module__': 'PyFoam.Applications.Comparator', 'doIt': <function Command.doIt>, 'parallel': None})
__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
__weakref__

list of weak references to the object (if defined)

doIt(para)[source]
execute(vals, log)[source]
Parameters:vals – Dictionary with the keywords
Returns:A boolean whether it completed successfully and a list with results (None if no results are generated)
parallel = None

Abstract base class of all commands

class PyFoam.Applications.Comparator.CommandChain(c)[source]

Bases: object

Abstract base class for a number of commands

__dict__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'CommandChain' objects>, 'hasObjectOfType': <function CommandChain.hasObjectOfType>, '__init__': <function CommandChain.__init__>, '__doc__': 'Abstract base class for a number of commands', 'execute': <function CommandChain.execute>, '__dict__': <attribute '__dict__' of 'CommandChain' objects>, '__module__': 'PyFoam.Applications.Comparator'})
__init__(c)[source]
Parameters:c – XML-Subtree that represents the chain
__module__ = 'PyFoam.Applications.Comparator'
__weakref__

list of weak references to the object (if defined)

execute(para, log)[source]

Executes the chain :param para:A dictionary with the parameters :param log: Logfile to write to

hasObjectOfType(typ)[source]

Checks whether there is an object of a specific type

class PyFoam.Applications.Comparator.Comparator(args=None, **kwargs)[source]

Bases: PyFoam.Applications.PyFoamApplication.PyFoamApplication

__init__(args=None, **kwargs)[source]
__module__ = 'PyFoam.Applications.Comparator'
addOptions()[source]
run()[source]
class PyFoam.Applications.Comparator.ComparatorData(doc)[source]

Bases: object

The object that holds the actual data

_ComparatorData__parseBase(e)
Parameters:e – The ‘base’-element
__dict__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'ComparatorData' objects>, '__len__': <function ComparatorData.__len__>, '__init__': <function ComparatorData.__init__>, '__doc__': ' The object that holds the actual data', '__getitem__': <function ComparatorData.__getitem__>, '_ComparatorData__parseBase': <function ComparatorData.__parseBase>, '__module__': 'PyFoam.Applications.Comparator', '__dict__': <attribute '__dict__' of 'ComparatorData' objects>})
__getitem__(nr)[source]
Parameters:nr – Number of the variation
Returns:dictionary with the variation
__init__(doc)[source]
Parameters:doc – the parsed XML-data from which the object is constructed
__len__()[source]
Returns:The total number of variations
__module__ = 'PyFoam.Applications.Comparator'
__weakref__

list of weak references to the object (if defined)

class PyFoam.Applications.Comparator.CopyLogCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Copies the log file to the results

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.DecomposeCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Decomposes a case and generates the LAM

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.DerivedCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Derives an additional value

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.DictWriteCommand(c)[source]

Bases: PyFoam.Applications.Comparator.SetterCommand

Writes a value to a dictionary

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.DictionaryCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Returns values from the chains dictionaries

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.EvaluationChain(c)[source]

Bases: PyFoam.Applications.Comparator.CommandChain

Chain of evaluation commands

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
class PyFoam.Applications.Comparator.FieldSetterCommand(c)[source]

Bases: PyFoam.Applications.Comparator.SetterCommand

Common class for commands that set values on fields

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
class PyFoam.Applications.Comparator.FoamCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Executes a OpenFOAM-utility

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.FoamUtilityCommand(c)[source]

Bases: PyFoam.Applications.Comparator.FoamCommand

Executes a OpenFOAM-utility and extracts information

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.FoamVersionCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Changes the used OpenFOAM-version

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.GenericCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Executes a shell command

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.InitialCommand(c)[source]

Bases: PyFoam.Applications.Comparator.FieldSetterCommand

Sets an initial condition

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.LastResultCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Copies the result of the last time-step to the resultsd directory

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.PreparationChain(c)[source]

Bases: PyFoam.Applications.Comparator.CommandChain

Chain of Preparation commands

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
class PyFoam.Applications.Comparator.ReconstructCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Reconstructs a case and deleted the LAM

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.SetDictionaryCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Sets value in the chains dictionaries

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.SetEnvironmentCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Sets an environment variable

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.SetterCommand(c)[source]

Bases: PyFoam.Applications.Comparator.Command

Common class for commands that operate on dictionaries

__init__(c)[source]
__module__ = 'PyFoam.Applications.Comparator'
execute(para, log)[source]
class PyFoam.Applications.Comparator.Variation(e)[source]

Bases: object

Represents one variation

__dict__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'Variation' objects>, '__dict__': <attribute '__dict__' of 'Variation' objects>, '__init__': <function Variation.__init__>, '__doc__': 'Represents one variation', '__getitem__': <function Variation.__getitem__>, '__module__': 'PyFoam.Applications.Comparator', '__len__': <function Variation.__len__>, '__str__': <function Variation.__str__>})
__getitem__(key)[source]
__init__(e)[source]
Parameters:e – the XML-data from which it is created
__len__()[source]
Returns:number of values
__module__ = 'PyFoam.Applications.Comparator'
__str__()[source]
__weakref__

list of weak references to the object (if defined)

PyFoam.Applications.Comparator.getNonEmpty(e, name, default=None)[source]
PyFoam.Applications.Comparator.replaceValues(orig, para)[source]

Replaces all strings enclosed by $$ with the parameters :param orig: the original string :param para: dictionary with the parameters