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-------------------------------------------------------------------------------
11License
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
33inline Foam::string
35{
36 return e.stream().toString();
37}
38
39
40template<class Type>
41inline Foam::string
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
58template<class Type>
59inline Foam::string
61{
62 Type data(Zero);
63 is >> data;
64
65 return toExprStr<Type>(data);
66}
67
68
69// ************************************************************************* //
Foam::string str() const
Get the string - as Foam::string rather than std::string.
Definition: StringStream.H:88
void evaluate()
Evaluate boundary conditions.
An input stream of tokens.
Definition: ITstream.H:56
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Definition: StringStream.H:231
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
static string toExprStr(const Type &data)
A class for handling character strings derived from std::string.
Definition: string.H:79
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
uint8_t direction
Definition: direction.H:56
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
volScalarField & e
Definition: createFields.H:11