butterfly.runmanager_bluecfd module

Runmanager for butterfly.

Run Butterfly on Windows using blueCFD: http://bluecfd.github.io/Core/About/

This class has been tested against blueCFD-Core 2017-2: http://bluecfd.github.io/Core/Downloads/

class butterfly.runmanager_bluecfd.RunManagerBlueCFD(project_name)[source]

Bases: object

RunManager BlueCFD to write and run OpenFOAM commands through batch files.

ToString()[source]

Overwrite .NET ToString method.

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).
Returns:

(cmd, logfiles, errorfiles)

duplicate()[source]

Return a copy of this object.

ensure_user_is_admin()[source]

Ensure user is logged in as admin.

If user is not admin raise UserNotAdminError.

is_ironpython

Check if the platform is IronPython.

is_user_admin

Return True if user is admin.

process

Return PID for the latest command.

run(command, args=None, decomposeParDict=None, wait=True)[source]

Run OpenFOAM command.

shellinit = None
terminate(pid=None, force=False)[source]

Kill the command using the pid.

exception butterfly.runmanager_bluecfd.UserNotAdminError[source]

Bases: exceptions.Exception

Exception for non-admin users.