forked from tomrobin-teschner/OpenFOAMCaseGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenFOAMCaseGenerator.py
More file actions
34 lines (26 loc) · 1.19 KB
/
Copy pathOpenFOAMCaseGenerator.py
File metadata and controls
34 lines (26 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import src.CaseGenerator.Properties.CaseProperties as CaseProperties
import src.CaseGenerator.FileDirectoryIO as FileIO
import src.CaseGenerator.Checker as Checker
from src.CaseGenerator.Properties.CaseFactory import CaseFactory
from src.CaseGenerator.Properties.CaseProperties import CaseProperties
from src.CaseGenerator import CaseGenerator
def main():
# process command line arguments first
command_line_arguments = Checker.CheckCommandLineArguments()
# create case
case_name = command_line_arguments['case']
parameters = command_line_arguments['parameter']
run_checks = not command_line_arguments['no-checks']
factory = CaseFactory(case_name, parameters)
# add additional, default parameters to properties
case_handler = CaseProperties()
case_properties = factory.get_case_properties()
case_properties = case_handler.add_default_properties(case_properties)
# hand-off case generation to dedicated class
case = CaseGenerator(case_properties, run_checks)
case.generate_case()
# output diagnostics
screen_output = FileIO.ScreenOutput(case_properties)
screen_output.print_summary(command_line_arguments)
if __name__ == '__main__':
main()