PyFoam.Infrastructure.CTestRun module¶
A wrapper to run a solver as a CTest
-
class
PyFoam.Infrastructure.CTestRun.
CTestRun
[source]¶ Bases:
object
This class runs a solver on a test case, examines the results and fails if they don’t live up the expectations
-
addFunctionObjects
(templateFile)[source]¶ Add entries for libraries and functionObjects to the controlDict (if they don’t exist :param templateFile: file withe the data that should be added
-
cloneData
(src, dst)[source]¶ Copy files recurivly into a case :param src: the source directory the files come fro :param dst: the destination directory the files go to
-
compareSamples
(data, reference, fields, time=None, line=None, scaleData=1, offsetData=0, scaleX=1, offsetX=0, useReferenceForComparison=False)[source]¶ Compare sample data and return the statistics :param data: the name of the data directory :param reference:the name of the directory with the reference data :param fields: list of the fields to compare :param time: the time to compare for. If empty the latest time is used
-
compareTimelines
(data, reference, fields)[source]¶ Compare timeline data and return the statistics :param data: the name of the data directory :param reference:the name of the directory with the reference data :param fields: list of the fields to compare
-
execute
(*args, **kwargs)[source]¶ Execute the passed arguments on the case and check if everything went alright :param regexps: a list of regular expressions that the output should be scanned for
-
fail
(*args)[source]¶ To be called if the test failed but other tests should be tried :param args: arbitrary number of arguments that build the fail-message
-
failGeneral
(prefix, *args)[source]¶ Parameters: args – arbitrary number of arguments that build the fail-message :param prefix: General classification of the failure
-
fatalFail
(*args)[source]¶ Parameters: args – arbitrary number of arguments that build the fail-message
-
meshPrepare
()[source]¶ Callback to prepare the mesh for the case. Default behaviour is to run blockMesh on the case
-
messageGeneral
(prefix, say, *args)[source]¶ Everything that passes through this method will be repeated in the end :param args: arbitrary number of arguments that build the fail-message :param prefix: General classification of the message
-
parallelPrepare
()[source]¶ Callback to prepare the case in parallel (after it was decomposed). Default behaviour is to do nothing
-
postprocess
()[source]¶ Callback to run after the solver has finished. Default behaviour is to do nothing
-
preRunTestCheckMesh
()[source]¶ This test is always run. If this is not desirable it has to be overridden in a child-class
-
runAndCatchExceptions
(func, *args, **kwargs)[source]¶ Run a callable and catch Python-exceptions if they occur :param func: The actual thing to be run
-
shell
(*args)[source]¶ Run a command in the case directory and let it directly write to the output :param workingDirectory: change to this directory
-
timeoutDefinitions
= [('unknown', 60), ('tiny', 60), ('small', 300), ('medium', 1800), ('big', 7200), ('huge', 43200), ('monster', 172800), ('unlimited', 2592000)]¶
-
wrapACallback
(name)[source]¶ Has to be a separate method because the loop in wrapCallbacks didn’t work
-