dimensionedTensor.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) 2011-2013 OpenFOAM Foundation
9 Copyright (C) 2020 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 "dimensionedTensor.H"
30
31// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
33namespace Foam
34{
35
36// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37
38template<>
40{
42 (
43 name()+".T()",
44 dimensions(),
45 value().T()
46 );
47}
48
49
50// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
51
53{
55 (
56 "tr("+dt.name()+')',
57 dt.dimensions(),
58 tr(dt.value())
59 );
60}
61
62
64{
66 (
67 "dev("+dt.name()+')',
68 dt.dimensions(),
69 dev(dt.value())
70 );
71}
72
73
75{
77 (
78 "dev2("+dt.name()+')',
79 dt.dimensions(),
80 dev2(dt.value())
81 );
82}
83
84
86{
88 (
89 "det("+dt.name()+')',
91 det(dt.value())
92 );
93}
94
95
97{
99 (
100 "cof("+dt.name()+')',
101 pow(dt.dimensions(), tensor::dim - 1),
102 cof(dt.value())
103 );
104}
105
106
108{
109 return dimensionedTensor
110 (
111 "inv("+dt.name()+')',
112 inv(dt.dimensions()),
113 inv(dt.value())
114 );
115}
116
117
119{
121 (
122 "symm("+dt.name()+')',
123 dt.dimensions(),
124 symm(dt.value())
125 );
126}
127
129{
131 (
132 "twoSymm("+dt.name()+')',
133 dt.dimensions(),
134 twoSymm(dt.value())
135 );
136}
137
139{
140 return dimensionedTensor
141 (
142 "skew("+dt.name()+')',
143 dt.dimensions(),
144 skew(dt.value())
145 );
146}
147
148
150{
151 return dimensionedVector
152 (
153 "eigenValues("+dt.name()+')',
154 dt.dimensions(),
155 eigenValues(dt.value())
156 );
157}
158
159
161{
162 return dimensionedTensor
163 (
164 "eigenVectors("+dt.name()+')',
165 dimless,
166 eigenVectors(dt.value())
167 );
168}
169
170
171// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
172
174{
175 return dimensionedVector
176 (
177 "*"+dt.name(),
178 dt.dimensions(),
179 *dt.value()
180 );
181}
182
183
185{
186 return dimensionedTensor
187 (
188 "*"+dv.name(),
189 dv.dimensions(),
190 *dv.value()
191 );
192}
193
194
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197} // End namespace Foam
198
199// ************************************************************************* //
const dimensionSet & dimensions() const
Return const reference to dimensions.
const Type & value() const
Return const reference to value.
const word & name() const
Return const reference to name.
dimensioned< Type > T() const
Return transpose.
static constexpr direction dim
Dimensionality of space.
Definition: bool.H:92
Namespace for OpenFOAM.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
const dimensionSet dimless
Dimensionless.
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
dimensioned< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensionedTensor skew(const dimensionedTensor &dt)