Loading...
Searching...
No Matches
Foam::foamVersion Namespace Reference

Namespace for OpenFOAM version information. More...

Functions

bool patched ()
 Test if the patch string appears to be in use, which is when it is defined (non-zero).
unsigned labelByteSize (const std::string &str)
 Extract label size (in bytes) from "label=" tag in string.
unsigned scalarByteSize (const std::string &str)
 Extract scalar size (in bytes) from "scalar=" tag in string.
void printBuildInfo (std::ostream &os, const bool full=true)
 Print information about version, build, arch to output stream.
std::string configuredProjectDir ()
 Compile-time definition of the OpenFOAM project directory or empty if not defined.
std::string configuredEtcDir ()
 Compile-time definition of the OpenFOAM etc/ directory or empty if not defined.

Variables

const int api
 OpenFOAM api number (integer) corresponding to the value of OPENFOAM at the time of compilation.
const std::string patch
 OpenFOAM patch number as a std::string.
const std::string build
 OpenFOAM build information as a std::string.
const std::string buildArch
 OpenFOAM build architecture information (machine endian, label/scalar sizes) as a std::string.
const std::string version
 OpenFOAM version (name or stringified number) as a std::string.

Detailed Description

Namespace for OpenFOAM version information.

Version information.

Note
Compile-time version information is conveyed by the OPENFOAM define provided in the wmake rules "General/general" and compile-time configuration of some paths via FOAM_EXTRA_CXXFLAGS:
  • FOAM_CONFIGURED_PROJECT_DIR
  • FOAM_CONFIGURED_PROJECT_ETC

For example,

FOAM_EXTRA_CXXFLAGS='-DFOAM_CONFIGURED_PROJECT_ETC=\"/etc/openfoam\"'

The foamVersion.H file is located directly in the src/OpenFOAM/include directory for easier use by external packages and to allow easier modification during packaging.

Source files

Function Documentation

◆ patched()

bool patched ( )

Test if the patch string appears to be in use, which is when it is defined (non-zero).

Referenced by argList::parse(), error::write(), and IOerror::write().

Here is the caller graph for this function:

◆ labelByteSize()

unsigned labelByteSize ( const std::string & str)

Extract label size (in bytes) from "label=" tag in string.

Referenced by IOobject::parseHeader().

Here is the caller graph for this function:

◆ scalarByteSize()

unsigned scalarByteSize ( const std::string & str)

Extract scalar size (in bytes) from "scalar=" tag in string.

Referenced by IOobject::parseHeader().

Here is the caller graph for this function:

◆ printBuildInfo()

void printBuildInfo ( std::ostream & os,
const bool full = true )

Print information about version, build, arch to output stream.

Eg,

Using: OpenFOAM-<VER> (API) - visit www.openfoam.com
Build: <BUILD> (patch=...)
Arch: <ARCH_INFO>
const std::string patch
OpenFOAM patch number as a std::string.
Parameters
osthe output stream
fullincludes Arch information

References os().

Referenced by argList::parse(), and argList::printUsage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ configuredProjectDir()

std::string configuredProjectDir ( )

Compile-time definition of the OpenFOAM project directory or empty if not defined.

Functional equivalent to WM_PROJECT_DIR.

◆ configuredEtcDir()

std::string configuredEtcDir ( )

Compile-time definition of the OpenFOAM etc/ directory or empty if not defined.

Functional equivalent to WM_PROJECT_DIR/etc

Variable Documentation

◆ api

◆ patch

const std::string patch
extern

OpenFOAM patch number as a std::string.

Referenced by argList::parse(), foamReport::setStaticBuiltins(), error::write(), and IOerror::write().

◆ build

const std::string build
extern

OpenFOAM build information as a std::string.

Referenced by argList::parse(), foamReport::setStaticBuiltins(), and profilingSysInfo::writeEntries().

◆ buildArch

const std::string buildArch
extern

OpenFOAM build architecture information (machine endian, label/scalar sizes) as a std::string.

Referenced by argList::parse(), foamReport::setStaticBuiltins(), IOobject::writeHeaderContent(), and IOobject::writeHeaderContent().

◆ version

const std::string version
extern

OpenFOAM version (name or stringified number) as a std::string.

Referenced by argList::parse(), foamReport::setStaticBuiltins(), and profilingSysInfo::writeEntries().