expressionEntryDimensioned.C
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-2021 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
30#include "primitiveEntry.H"
31#include "dimensionedScalar.H"
32#include "dimensionedVector.H"
33#include "dimensionedTensor.H"
37
38// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39
40namespace Foam
41{
42namespace exprTools
43{
44
46(
49 empty,
51);
52
54(
57 empty,
59);
60
62(
65 empty,
67);
68
70(
73 empty,
75);
76
78(
81 empty,
83);
84
85} // End namespace exprTools
86} // End namespace Foam
87
88
89// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
90
91#undef defineExpressionEntryType
92#define defineExpressionEntryType(DimType) \
93 Foam::string Foam::exprTools::DimType##Entry::evaluate(const entry& e) \
94 { \
95 DimType dt(dynamicCast<const primitiveEntry>(e)); \
96 return toExprStr<DimType::value_type>(dt.value()); \
97 }
98
99
101{
102 dimensionedScalar dt(dynamicCast<const primitiveEntry>(e));
103 return std::to_string(dt.value());
104}
105
106
111
112#undef defineExpressionEntryType
113
114// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
void evaluate()
Evaluate boundary conditions.
const Type & value() const
Return const reference to value.
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
Convert dictionary entry to a stringified expression.
A class for handling character strings derived from std::string.
Definition: string.H:79
#define defineExpressionEntryType(DimType)
Creates an expression string from various standard dimensioned types.
Namespace for OpenFOAM.
volScalarField & e
Definition: createFields.H:11
Create an expression string from a dimensionedScalar as its value.
Create an expression string from a dimensionedSphericalTensor as its value.
Create an expression string from a dimensionedSymmTensor as its value.
Create an expression string from a dimensionedTensor as its value.
Create an expression string from a dimensionedVector as its value.