OpenFOAM
v2406
The open source CFD toolbox
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
Copyright (C) 2014-2018 Bernhard Gschaider
9
Copyright (C) 2019-2021 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 "
expressionEntryDimensioned.H
"
30
#include "
primitiveEntry.H
"
31
#include "
dimensionedScalar.H
"
32
#include "
dimensionedVector.H
"
33
#include "
dimensionedTensor.H
"
34
#include "
dimensionedSymmTensor.H
"
35
#include "
dimensionedSphericalTensor.H
"
36
#include "
addToRunTimeSelectionTable.H
"
37
38
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39
40
namespace
Foam
41
{
42
namespace
exprTools
43
{
44
45
addNamedToRunTimeSelectionTable
46
(
47
expressionEntry,
48
dimensionedScalarEntry,
49
empty,
50
dimensionedScalar
51
);
52
53
addNamedToRunTimeSelectionTable
54
(
55
expressionEntry,
56
dimensionedVectorEntry,
57
empty,
58
dimensionedVector
59
);
60
61
addNamedToRunTimeSelectionTable
62
(
63
expressionEntry,
64
dimensionedTensorEntry,
65
empty,
66
dimensionedTensor
67
);
68
69
addNamedToRunTimeSelectionTable
70
(
71
expressionEntry,
72
dimensionedSymmTensorEntry,
73
empty,
74
dimensionedSymmTensor
75
);
76
77
addNamedToRunTimeSelectionTable
78
(
79
expressionEntry,
80
dimensionedSphericalTensorEntry,
81
empty,
82
dimensionedSphericalTensor
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
100
Foam::string
Foam::exprTools::dimensionedScalarEntry::evaluate
(
const
entry
&
e
)
101
{
102
dimensionedScalar
dt(dynamicCast<const primitiveEntry>(
e
));
103
return
std::to_string(dt.value());
104
}
105
106
107
defineExpressionEntryType
(
dimensionedVector
);
108
defineExpressionEntryType
(
dimensionedTensor
);
109
defineExpressionEntryType
(
dimensionedSymmTensor
);
110
defineExpressionEntryType
(
dimensionedSphericalTensor
);
111
112
#undef defineExpressionEntryType
113
114
// ************************************************************************* //
dimensionedSphericalTensor.H
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition:
dimensionedVector.H:46
primitiveEntry.H
Foam::dimensioned< scalar >
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::constant::electromagnetic::e
const dimensionedScalar e
Elementary charge.
Definition:
createFields.H:11
Foam::dimensionedTensor
dimensioned< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.
Definition:
dimensionedTensor.H:48
dimensionedVector.H
Foam::exprTools::dimensionedScalarEntry::evaluate
static string evaluate(const entry &e)
Entry to string.
Definition:
expressionEntryDimensioned.C:93
Foam::dimensionedSymmTensor
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
Definition:
dimensionedSymmTensor.H:46
Foam::dimensionedSphericalTensor
dimensioned< sphericalTensor > dimensionedSphericalTensor
Dimensioned sphericalTensor obtained from generic dimensioned type.
Definition:
dimensionedSphericalTensor.H:46
dimensionedScalar.H
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition:
dimensionedScalarFwd.H:33
dimensionedTensor.H
dimensionedSymmTensor.H
Foam::exprTools::addNamedToRunTimeSelectionTable
addNamedToRunTimeSelectionTable(expressionEntry, expressionEntry, empty, direct)
Foam::string
A class for handling character strings derived from std::string.
Definition:
string.H:72
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:26
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition:
entry.H:63
defineExpressionEntryType
#define defineExpressionEntryType(DimType)
Definition:
expressionEntryDimensioned.C:85
expressionEntryDimensioned.H
Creates an expression string from various standard dimensioned types.
src
OpenFOAM
expressions
exprEntry
expressionEntryDimensioned.C
Generated by
1.8.14