1
2 """
3 Application class that implements pyFoamUtilityRunner
4 """
5
6 from PyFoamApplication import PyFoamApplication
7
8 from PyFoam.Execution.UtilityRunner import UtilityRunner
9
10 import sys
11 from os import path
12
15 description="""
16 Runs a OpenFoam Utility and analyzes the output. Needs a regular
17 expression to look for. The next 3 arguments are the usual OpenFoam
18 argumens (<solver> <directory> <case>) and passes them on (plus
19 additional arguments). Output is sent to stdout and a logfile inside
20 the case directory (PyFoamUtility.logfile). The Directory
21 PyFoamUtility.analyzed contains a file test with the information of
22 the regexp (the pattern groups).
23 """
24
25 PyFoamApplication.__init__(self,
26 exactNr=False,
27 args=args,
28 description=description)
29
31 self.parser.add_option("-r",
32 "--regexp",
33 type="string",
34 dest="regexp",
35 help="The regular expression to look for")
36
37 self.parser.add_option("-n",
38 "--name",
39 type="string",
40 dest="name",
41 default="test",
42 help="The name for the resulting file")
43
44 self.parser.add_option("--echo",
45 action="store_true",
46 dest="echo",
47 default=False,
48 help="Echo the result file after the run")
49
50 self.parser.add_option("--silent",
51 action="store_true",
52 dest="silent",
53 default=False,
54 help="Don't print the output of the utility to the console")
55
87