butterfly.runmanager module¶
Runmanager for butterfly.
Run manager is only useful for running OpenFOAM for Windows which runs in a docker container. For linux systems simply use .bash files or libraries such as pyFOAM.
-
class
butterfly.runmanager.
RunManager
(project_name)[source]¶ Bases:
object
RunManager to write and run OpenFOAM commands through batch files.
Run manager is currently only useful for running OpenFOAM for Windows which runs in a docker container. For linux systems simply use .bash files or libraries such as pyFOAM.
-
check_file_contents
(files, mute=False)[source]¶ Check files for content and print them out if any.
Parameters: files – A list of ASCII files. Returns: (hasContent, content) hasContent: A boolean that shows if there is any contents. content: Files content if any
-
command
(cmd, args=None, decomposeParDict=None, include_header=True)[source]¶ Get command line for an OpenFOAM command in parallel or serial.
Parameters: - cmd – An OpenFOAM command.
- args – List of optional arguments for command. e.g. (‘c’, ‘latestTime’)
- decomposeParDict – decomposeParDict for parallel runs (default: None).
- include_header – Include header lines to set up the environment (default: True).
- tee – Include tee in command line.
Returns: (cmd, logfiles, errorfiles)
-
container_id
¶ Container ID.
-
ensure_user_is_admin
()[source]¶ Ensure user is logged in as admin.
If user is not admin raise UserNotAdminError.
-
is_user_admin
¶ Return True if user is admin.
-
pid
¶ Return PID for the latest command.
-
shellinit
= None¶
-