OpenFOAM: API Guide
v2006
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-2020 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
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
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
(std::ostream& os,
const
bool
full)
47
{
48
os <<
"Using: OpenFOAM-"
<<
foamVersion::version
49
<<
" ("
<<
foamVersion::api
<<
") - visit www.openfoam.com\n"
50
<<
"Build: "
<<
foamVersion::build
;
51
52
if
(
foamVersion::patched
())
53
{
54
// Patch-level, when defined
55
os <<
" (patch="
<<
foamVersion::patch
<<
')'
;
56
}
57
os <<
'\n'
;
58
59
if
(full)
60
{
61
os <<
"Arch: "
<<
foamVersion::buildArch
<<
'\n'
;
62
}
63
}
64
65
66
// ************************************************************************* //
Foam::foamVersion::build
const std::string build
OpenFOAM build information as a std::string.
Foam::foamVersion::printBuildInfo
void printBuildInfo(std::ostream &os, const bool full=true)
Print information about version, build, arch to output stream.
Definition:
foamVersion.C:46
Foam::foamVersion::api
const int api
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::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::foamVersion::buildArch
const std::string buildArch
foamVersion.H
src
OpenFOAM
global
version
foamVersion.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.