PyFoam.FoamInformation module

Getting Information about the Foam-Installation (like the installation directory)

class PyFoam.FoamInformation.VersionTuple[source]

Bases: tuple

Wrapper around the regular tuple that is printed in a way that can be parsed as a tuple in a OF-dictionary

PyFoam.FoamInformation.changeFoamVersion(new, force64=False, force32=False, compileOption=None, foamCompiler=None, wmCompiler=None)[source]

Changes the used FoamVersion. Only valid during the runtime of the interpreter (the script or the Python session) :param new: The new Version :param force64: Forces the 64-bit-version to be chosen :param force32: Forces the 32-bit-version to be chosen :param compileOption: Forces Debug or Opt :param wmCompiler: Force new value for WM_COMPILER :param foamCompiler: Force system or OpenFOAM-Compiler

PyFoam.FoamInformation.ensureDynamicLibraries()[source]

Ensure that the dynamic library path is set for systems where it was erased for security rasons (for instance Mac OS X 10.11)

PyFoam.FoamInformation.findInstallationDir(newVersion)[source]
PyFoam.FoamInformation.findInstalledVersions(basedir, valid, forkName='openfoam')[source]
PyFoam.FoamInformation.findThirdPartyDir(newVersion)[source]
PyFoam.FoamInformation.foamCaseDicts()[source]
Returns:the caseDicts-directory of the distro
PyFoam.FoamInformation.foamEtc()[source]
Returns:the etc-directory of the distro
PyFoam.FoamInformation.foamFork()[source]

The currently used fork of OpenFOAM/Foam

PyFoam.FoamInformation.foamInstalledVersions()[source]
Returns:A list with the installed versions of OpenFOAM
PyFoam.FoamInformation.foamMPI()[source]
Returns:the used MPI-Implementation
PyFoam.FoamInformation.foamPostProcessing()[source]
Returns:the caseDicts/postProcessing-directory of the distro
PyFoam.FoamInformation.foamTutorials()[source]
Returns:directory in which the tutorials reside
PyFoam.FoamInformation.foamVersion(useConfigurationIfNoInstallation=False)[source]
Returns:tuple that represents the Foam-version as found

in $WM_PROJECT_VERSION

PyFoam.FoamInformation.foamVersionNumber(useConfigurationIfNoInstallation=False)[source]
Returns:tuple that represents the Foam-Version-Number (without

strings

PyFoam.FoamInformation.foamVersionString(useConfigurationIfNoInstallation=False)[source]
Returns:string for the Foam-version as found

in $WM_PROJECT_VERSION

PyFoam.FoamInformation.getAuthenticatedKeys()[source]
PyFoam.FoamInformation.getPathFromEnviron(name)[source]

Gets a path from an environment variable :return: the path :rtype: string :param name: the name of the environment variable

PyFoam.FoamInformation.getPublicKey()[source]
PyFoam.FoamInformation.getUserName()[source]

Get the current username

PyFoam.FoamInformation.getUserTempDir()[source]

Return path to a user-specific private directory. Create directory if not existing

PyFoam.FoamInformation.injectVariables(script, forceArchOption=None, compileOption=None, foamCompiler=None, wmCompiler=None)[source]

Executes a script in a subshell and changes the current environment with the enivironment after the execution :param script: the script that is executed :param forceArchOption: To which architecture Option should be forced :param compileOption: to which value the WM_COMPILE_OPTION should be forced :param wmCompiler: Force new value for WM_COMPILER :param foamCompiler: Force system or OpenFOAM-Compiler

PyFoam.FoamInformation.installationPath()[source]

Path to the installation

PyFoam.FoamInformation.oldAppConvention()[source]

Returns true if the version of OpenFOAM is older than 1.5 and it therefor uses the ‘old’ convention to call utilities (“dot, case”)

PyFoam.FoamInformation.oldTutorialStructure()[source]

Returns true if the version of OpenFOAM is older than 1.6 and it therefor uses the ‘old’ (flat) structure for the tutorials

PyFoam.FoamInformation.shellExecutionPrefix(ensureDynamic=True, asList=False)[source]

Stuff to prefix to a call that is passed to the shell. Main application is currently to work around a security feature of Mac OS X 10.11 that doesn’t pass the load paths for the dynamic libraries to a shell