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 -------------------------------------------------------------------------------
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 "dimensionedTensor.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 
36 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
37 
38 template<>
40 {
41  return dimensionedTensor
42  (
43  name()+".T()",
44  dimensions(),
45  value().T()
46  );
47 }
48 
49 
50 // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
51 
53 {
54  return dimensionedScalar
55  (
56  "tr("+dt.name()+')',
57  dt.dimensions(),
58  tr(dt.value())
59  );
60 }
61 
62 
64 {
65  return dimensionedTensor
66  (
67  "dev("+dt.name()+')',
68  dt.dimensions(),
69  dev(dt.value())
70  );
71 }
72 
73 
75 {
76  return dimensionedTensor
77  (
78  "dev2("+dt.name()+')',
79  dt.dimensions(),
80  dev2(dt.value())
81  );
82 }
83 
84 
86 {
87  return dimensionedScalar
88  (
89  "det("+dt.name()+')',
90  pow(dt.dimensions(), tensor::dim),
91  det(dt.value())
92  );
93 }
94 
95 
97 {
98  return dimensionedTensor
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 {
120  return dimensionedSymmTensor
121  (
122  "symm("+dt.name()+')',
123  dt.dimensions(),
124  symm(dt.value())
125  );
126 }
127 
129 {
130  return dimensionedSymmTensor
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 // ************************************************************************* //
Foam::symm
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:84
Foam::skew
dimensionedTensor skew(const dimensionedTensor &dt)
Definition: dimensionedTensor.C:138
Foam::dimensionedSymmTensor
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
Definition: dimensionedSymmTensor.H:50
Foam::eigenValues
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
Definition: dimensionedTensor.C:149
Foam::eigenVectors
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
Definition: dimensionedTensor.C:160
Foam::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:406
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:434
Foam::dev2
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:117
Foam::dimensioned::T
dimensioned< Type > T() const
Return transpose.
Definition: dimensionedSphericalTensor.C:38
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:50
Foam::inv
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:73
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:42
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cof
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:139
dimensionedTensor.H
Foam::operator*
tmp< faMatrix< Type > > operator*(const areaScalarField &, const faMatrix< Type > &)
Foam::tr
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:51
Foam::det
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:62
Foam::dimensioned::dimensions
const dimensionSet & dimensions() const
Return const reference to dimensions.
Definition: dimensionedType.C:420
Foam::twoSymm
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:95
Foam::dimensionedTensor
dimensioned< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.
Definition: dimensionedTensor.H:52
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189
Foam::dev
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:106