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

Module FoamInformation

source code

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

Classes [hide private]
  VersionTuple
Wrapper around the regular tuple that is printed in a way that can be parsed as a tuple in a OF-dictionary
Functions [hide private]
 
changeFoamVersion(new, force64=False, force32=False, compileOption=None, foamCompiler=None, wmCompiler=None)
Changes the used FoamVersion.
source code
 
findInstallationDir(newVersion) source code
 
findInstalledVersions(basedir, valid, forkName='openfoam') source code
 
foamFork()
The currently used fork of OpenFOAM/Foam
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, foamCompiler=None, wmCompiler=None)
Executes a script in a subshell and changes the current environment with the enivironment after the execution
source code
 
installationPath()
Path to the installation
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
  __foamInstallations = None
hash(x)
  __package__ = 'PyFoam'
  environ = {'M4_SYSTEM': '1', 'CMAKE_SYSTEM': '1', 'WM_NCOMPPRO...

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


Function Details [hide private]

changeFoamVersion(new, force64=False, force32=False, compileOption=None, foamCompiler=None, wmCompiler=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
  • wmCompiler - Force new value for WM_COMPILER
  • foamCompiler - Force system or OpenFOAM-Compiler

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, foamCompiler=None, wmCompiler=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
  • wmCompiler - Force new value for WM_COMPILER
  • foamCompiler - Force system or OpenFOAM-Compiler

Variables Details [hide private]

environ

Value:
{'M4_SYSTEM': '1', 'CMAKE_SYSTEM': '1', 'WM_NCOMPPROCS': '1', 'WM_MPLI\
B': 'MACPORTOPENMPI', 'METIS_SYSTEM': '1', 'LESS': '-R', 'WM_CXXFLAGS'\
: '-m64 -fPIC', 'WM_COMPILER_ARCH': '', 'HWLOC_SYSTEM': '1', 'DBUS_LAU\
NCHD_SESSION_BUS_SOCKET': '/tmp/launch-YT2LFL/unix_domain_listener', '\
FOAM_LIB': '/Users/bgschaid/foam/foam-extend-3.1/lib', 'SHELL': '/bin/\
zsh', 'WM_ARCH_BASE': 'darwin', 'SECURITYSESSIONID': '186a4', 'WM_OPTI\
ONS': 'darwinIntel64Gcc48DPDebug', 'FLEX_SYSTEM': '1', 'PARMETIS_DIR':\
 '/opt/local', 'FOAM_MPI_LIBBIN': '/Users/bgschaid/foam/foam-extend-3.\
...