OpenFOAM: API Guide
v2112
The open source CFD toolbox
expressionEntryI.H
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration |
5
\\ / A nd | www.openfoam.com
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
Original code Copyright (C) 2014-2018 Bernhard Gschaider
9
Copyright (C) 2019 OpenCFD Ltd.
10
-------------------------------------------------------------------------------
11
License
12
This file is part of OpenFOAM.
13
14
OpenFOAM is free software: you can redistribute it and/or modify it
15
under the terms of the GNU General Public License as published by
16
the Free Software Foundation, either version 3 of the License, or
17
(at your option) any later version.
18
19
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22
for more details.
23
24
You should have received a copy of the GNU General Public License
25
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27
\*---------------------------------------------------------------------------*/
28
29
#include "
OStringStream.H
"
30
31
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32
33
inline
Foam::string
34
Foam::exprTools::expressionEntry::evaluate
(
const
entry
&
e
)
35
{
36
return
e
.stream().toString();
37
}
38
39
40
template
<
class
Type>
41
inline
Foam::string
42
Foam::exprTools::expressionEntry::toExprStr
(
const
Type&
data
)
43
{
44
OStringStream
buf;
45
46
buf << pTraits<Type>::typeName <<
'('
;
47
for
(
direction
cmpt=0; cmpt < pTraits<Type>::nComponents; ++cmpt)
48
{
49
if
(cmpt) buf <<
','
;
50
buf <<
component
(
data
, cmpt);
51
}
52
buf <<
')'
;
53
54
return
buf.
str
();
55
}
56
57
58
template
<
class
Type>
59
inline
Foam::string
60
Foam::exprTools::expressionEntry::toExprStr
(
ITstream
& is)
61
{
62
Type
data
(
Zero
);
63
is >>
data
;
64
65
return
toExprStr<Type>(
data
);
66
}
67
68
69
// ************************************************************************* //
OStringStream.H
Foam::Detail::StringStreamAllocator::str
Foam::string str() const
Get the string - as Foam::string rather than std::string.
Definition:
StringStream.H:88
Foam::GeometricBoundaryField::evaluate
void evaluate()
Evaluate boundary conditions.
Definition:
GeometricBoundaryField.C:433
Foam::ITstream
An input stream of tokens.
Definition:
ITstream.H:56
Foam::OStringStream
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Definition:
StringStream.H:231
Foam::data
Database for solution data, solver performance and other reduced data.
Definition:
data.H:58
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition:
entry.H:70
Foam::exprTools::expressionEntry::toExprStr
static string toExprStr(const Type &data)
Foam::string
A class for handling character strings derived from std::string.
Definition:
string.H:79
Foam::component
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Definition:
FieldFieldFunctions.C:44
Foam::direction
uint8_t direction
Definition:
direction.H:56
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition:
zero.H:131
e
volScalarField & e
Definition:
createFields.H:11
src
OpenFOAM
expressions
exprEntry
expressionEntryI.H
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.