PyFoam.Applications.PrepareCase module

Application-class that implements pyFoamPrepareCase.py

class PyFoam.Applications.PrepareCase.PrepareCase(args=None, exactNr=True, interspersed=True, usage='%prog <caseDirectory>', examples=None, nr=1, description=None, **kwargs)[source]

Bases: PyFoam.Applications.PyFoamApplication.PyFoamApplication, PyFoam.Applications.CommonTemplateBehaviour.CommonTemplateBehaviour, PyFoam.Applications.CommonTemplateFormat.CommonTemplateFormat

addDictValues(name, description, values)[source]

Add values from a dictionary

addOptions()[source]
checkCorrectOptions(values, meta=None)[source]
cleanExtension(startDir, ext)[source]

Go recursivly through directories and remove all files that have a specific extension

copyOriginals(startDir, extension=None, recursive=True)[source]

Go recursivly through directories and copy foo.org to foo

executeScript(scriptName, workdir, echo, allrun=None)[source]

Execute a script and write a corresponding logfile

getDefaultValues(cName)[source]

Process the file with the default values - if present Returns a dictionary with the values and a dictionary with the meta-data about the parameters

info(*args)[source]

Information output

listdir(d, ext)[source]

Private copy of listdir. Returns a list of pairs: first element is the real file-name. Second the name with the extensions stripped off or None if the file doesn’t match any extensions

makeReport(values, level=2, meta=None)[source]
overloadDir(here, there)[source]

Copy files recursively. Overwrite local copies if they exist

parameterOutFile = 'PyFoamPrepareCaseParameters'
prepare(sol, cName=None, overrideParameters=None, numberOfProcessors=None)[source]

Do the actual preparing :param numberOfProcessors: If set this overrides the value set in the command line

processDefault(raw)[source]

Process a dictionary and return a ‘flattened’ dictionary with the values and a dictionary with the meta-data

run()[source]
searchAndReplaceTemplates(startDir, values, templateExt, ignoreDirectories=[])[source]

Go through the directory recursively and replate foo.template with foo after inserting the values

PyFoam.Applications.PrepareCase.buildFilenameExtension(paraList, valueStrings)[source]