OpenFOAM: API Guide
v2112
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
Original code 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
// ************************************************************************* //
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
Definition:
addToRunTimeSelectionTable.H:60
Foam::GeometricBoundaryField::evaluate
void evaluate()
Evaluate boundary conditions.
Definition:
GeometricBoundaryField.C:433
Foam::dimensioned< scalar >
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition:
dimensionedType.C:434
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition:
entry.H:70
Foam::exprTools::expressionEntry
Convert dictionary entry to a stringified expression.
Definition:
expressionEntry.H:86
Foam::string
A class for handling character strings derived from std::string.
Definition:
string.H:79
dimensionedScalar.H
dimensionedSphericalTensor.H
dimensionedSymmTensor.H
dimensionedTensor.H
dimensionedVector.H
defineExpressionEntryType
#define defineExpressionEntryType(DimType)
Definition:
expressionEntryDimensioned.C:92
expressionEntryDimensioned.H
Creates an expression string from various standard dimensioned types.
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:34
primitiveEntry.H
e
volScalarField & e
Definition:
createFields.H:11
Foam::exprTools::dimensionedScalarEntry
Create an expression string from a dimensionedScalar as its value.
Definition:
expressionEntryDimensioned.H:63
Foam::exprTools::dimensionedSphericalTensorEntry
Create an expression string from a dimensionedSphericalTensor as its value.
Definition:
expressionEntryDimensioned.H:67
Foam::exprTools::dimensionedSymmTensorEntry
Create an expression string from a dimensionedSymmTensor as its value.
Definition:
expressionEntryDimensioned.H:66
Foam::exprTools::dimensionedTensorEntry
Create an expression string from a dimensionedTensor as its value.
Definition:
expressionEntryDimensioned.H:65
Foam::exprTools::dimensionedVectorEntry
Create an expression string from a dimensionedVector as its value.
Definition:
expressionEntryDimensioned.H:64
src
OpenFOAM
expressions
exprEntry
expressionEntryDimensioned.C
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.