Foam::foamVersion Namespace Reference

Namespace for OpenFOAM version information. More...

Functions

bool patched ()
 
unsigned labelByteSize (const std::string &str)
 Extract label size (in bytes) from "label=" tag in string. More...
 
unsigned scalarByteSize (const std::string &str)
 Extract scalar size (in bytes) from "scalar=" tag in string. More...
 
void printBuildInfo (std::ostream &os, const bool full=true)
 Print information about version, build, arch to output stream. More...
 
std::string configuredProjectDir ()
 
std::string configuredEtcDir ()
 

Variables

const int api
 
const std::string patch
 OpenFOAM patch number as a std::string. More...
 
const std::string build
 OpenFOAM build information as a std::string. More...
 
const std::string buildArch
 
const std::string version
 OpenFOAM version (name or stringified number) as a std::string. More...
 

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

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

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

const int api
extern

OpenFOAM api number (integer) corresponding to the value of OPENFOAM at the time of compilation.

The value is 0 if OPENFOAM was not defined.

Referenced by Foam::apiYear(), dynamicCode::checkSecurity(), argList::displayDoc(), Foam::etcDirs(), Foam::findEtcEntries(), argList::parse(), argList::printMan(), systemCall::read(), error::warnAboutAge(), error::write(), IOerror::write(), and IOobject::writeBanner().

◆ patch

const std::string patch
extern

OpenFOAM patch number as a std::string.

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

◆ build

const std::string build
extern

OpenFOAM build information as a std::string.

Referenced by argList::parse(), and profilingSysInfo::write().

◆ buildArch

const std::string buildArch
extern

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

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

◆ version

const std::string version
extern

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

Referenced by argList::parse(), Foam::setversion(), and profilingSysInfo::write().