OpenFOAM: API Guide
v1912
The open source CFD toolbox
foamVersion.C
Go to the documentation of this file.
1
/*-------------------------------*- C++ -*-----------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration |
5
\\ / A nd | www.openfoam.com
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
Copyright (C) 2018-2019 OpenCFD Ltd.
9
-------------------------------------------------------------------------------
10
License
11
This file is part of OpenFOAM.
12
13
OpenFOAM is free software: you can redistribute it and/or modify it
14
under the terms of the GNU General Public License as published by
15
the Free Software Foundation, either version 3 of the License, or
16
(at your option) any later version.
17
18
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21
for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26
\*---------------------------------------------------------------------------*/
27
28
#include "
foamVersion.H
"
29
#include "
messageStream.H
"
30
31
// Static data members are constructed in global.Cver
32
33
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34
35
bool
Foam::foamVersion::patched
()
36
{
37
// Patch-level, when defined (non-zero) and not some @TOKEN@ rubbish
38
return
39
(
40
foamVersion::patch
.size() &&
foamVersion::patch
[0] !=
'@'
41
&& (
foamVersion::patch
.size() > 1 ||
foamVersion::patch
[0] !=
'0'
)
42
);
43
}
44
45
46
void
Foam::foamVersion::printBuildInfo
(
const
bool
full)
47
{
48
Info
<<
"Using: OpenFOAM-"
<<
foamVersion::version
.c_str()
49
<<
" ("
<<
foamVersion::api
<<
") - visit www.openfoam.com\n"
50
<<
"Build: "
<<
foamVersion::build
.c_str();
51
52
if
(
foamVersion::patched
())
53
{
54
// Patch-level, when defined
55
Info
<<
" (patch="
<<
foamVersion::patch
.c_str() <<
')'
;
56
}
57
Info
<<
nl
;
58
59
if
(full)
60
{
61
Info
<<
"Arch: "
<<
foamVersion::buildArch
.c_str() <<
nl
;
62
}
63
}
64
65
66
// ************************************************************************* //
Foam::foamVersion::build
const std::string build
OpenFOAM build information as a std::string.
Foam::foamVersion::api
const int api
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::foamVersion::version
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
messageStream.H
Foam::foamVersion::patched
bool patched()
Definition:
foamVersion.C:35
Foam::nl
constexpr char nl
Definition:
Ostream.H:372
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::foamVersion::buildArch
const std::string buildArch
Foam::foamVersion::printBuildInfo
void printBuildInfo(const bool full=true)
Print information about version, build, arch to Info.
Definition:
foamVersion.C:46
foamVersion.H
src
OpenFOAM
global
version
foamVersion.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.