Package PyFoam :: Module FoamInformation
[hide private]
[frames] | no frames]

Module FoamInformation

source code

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

Functions [hide private]
 
changeFoamVersion(new, force64=False, force32=False, compileOption=None)
Changes the used FoamVersion.
source code
 
findBaseDir(newDir) source code
 
findInstalledVersions(basedir, valid) source code
 
foamInstalledVersions()
Returns: A list with the installed versions of OpenFOAM
source code
 
foamMPI()
Returns: the used MPI-Implementation
source code
 
foamTutorials()
Returns: directory in which the tutorials reside
source code
 
foamVersion(useConfigurationIfNoInstallation=False)
Returns: tuple that represents the Foam-version as found in $WM_PROJECT_VERSION
source code
 
foamVersionNumber(useConfigurationIfNoInstallation=False)
Returns: tuple that represents the Foam-Version-Number (without strings
source code
 
foamVersionString(useConfigurationIfNoInstallation=False)
Returns: string for the Foam-version as found in $WM_PROJECT_VERSION
source code
string
getPathFromEnviron(name)
Gets a path from an environment variable
source code
 
injectVariables(script, forceArchOption=None, compileOption=None)
Executes a script in a subshell and changes the current environment with the enivironment after the execution
source code
 
oldAppConvention()
Returns true if the version of OpenFOAM is older than 1.5 and it therefor uses the 'old' convention to call utilities ("dot, case")
source code
 
oldTutorialStructure()
Returns true if the version of OpenFOAM is older than 1.6 and it therefor uses the 'old' (flat) structure for the tutorials
source code
Variables [hide private]
  PIPE = -1
  STDOUT = -2
  __package__ = 'PyFoam'
  environ = {'MANAGEDFLU_ROOT_DIR': '/Users/bgschaid/OpenFOAM/ma...

Imports: Popen, config, error, listdir, path, re, sys, warning


Function Details [hide private]

changeFoamVersion(new, force64=False, force32=False, compileOption=None)

source code 

Changes the used FoamVersion. Only valid during the runtime of the interpreter (the script or the Python session)

Parameters:
  • new - The new Version
  • force64 - Forces the 64-bit-version to be chosen
  • force32 - Forces the 32-bit-version to be chosen
  • compileOption - Forces Debug or Opt

foamInstalledVersions()

source code 
Returns:
A list with the installed versions of OpenFOAM

foamMPI()

source code 
Returns:
the used MPI-Implementation

foamTutorials()

source code 
Returns:
directory in which the tutorials reside

foamVersion(useConfigurationIfNoInstallation=False)

source code 
Returns:
tuple that represents the Foam-version as found in $WM_PROJECT_VERSION

foamVersionNumber(useConfigurationIfNoInstallation=False)

source code 
Returns:
tuple that represents the Foam-Version-Number (without strings

foamVersionString(useConfigurationIfNoInstallation=False)

source code 
Returns:
string for the Foam-version as found in $WM_PROJECT_VERSION

getPathFromEnviron(name)

source code 

Gets a path from an environment variable

Parameters:
  • name - the name of the environment variable
Returns: string
the path

injectVariables(script, forceArchOption=None, compileOption=None)

source code 

Executes a script in a subshell and changes the current environment with the enivironment after the execution

Parameters:
  • script - the script that is executed
  • forceArchOption - To which architecture Option should be forced
  • compileOption - to which value the WM_COMPILE_OPTION should be forced

Variables Details [hide private]

environ

Value:
{'MANAGEDFLU_ROOT_DIR': '/Users/bgschaid/OpenFOAM/managedflu-1.1-1', '\
LESS_TERMCAP_md': '\x1b[01;31m', 'WM_MPLIB': 'MACPORTOPENMPI', 'XTERM_\
LOCALE': 'C', 'WM_CXXFLAGS': '-m64 -fPIC', 'DBUS_LAUNCHD_SESSION_BUS_S\
OCKET': '/tmp/launch-wxvrPd/unix_domain_listener', 'FOAM_LIB': '/Users\
/bgschaid/OpenFOAM/OpenFOAM-1.7.x/lib', 'INFOPATH': '/opt/local/info:'\
, 'SHELL': '/bin/zsh', 'WM_ARCH_BASE': 'darwin', 'SECURITYSESSIONID': \
'186a5', 'WM_OPTIONS': 'darwinIntel64Gcc45DPOpt', 'FOAM_MPI_LIBBIN': '\
/Users/bgschaid/OpenFOAM/OpenFOAM-1.7.x/lib/darwinIntel64Gcc45DPOpt/op\
...