dimensionedTensor.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "dimensionedTensor.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 
33 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
34 
35 template<>
37 {
38  return dimensionedTensor
39  (
40  name()+".T()",
41  dimensions(),
42  value().T()
43  );
44 }
45 
46 
47 // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
48 
50 {
51  return dimensionedScalar
52  (
53  "tr("+dt.name()+')',
54  dt.dimensions(),
55  tr(dt.value())
56  );
57 }
58 
59 
61 {
62  return dimensionedTensor
63  (
64  "dev("+dt.name()+')',
65  dt.dimensions(),
66  dev(dt.value())
67  );
68 }
69 
70 
72 {
73  return dimensionedTensor
74  (
75  "dev2("+dt.name()+')',
76  dt.dimensions(),
77  dev2(dt.value())
78  );
79 }
80 
81 
83 {
84  return dimensionedScalar
85  (
86  "det("+dt.name()+')',
87  pow(dt.dimensions(), tensor::dim),
88  det(dt.value())
89  );
90 }
91 
92 
94 {
95  return dimensionedTensor
96  (
97  "cof("+dt.name()+')',
98  pow(dt.dimensions(), tensor::dim - 1),
99  cof(dt.value())
100  );
101 }
102 
103 
105 {
106  return dimensionedTensor
107  (
108  "inv("+dt.name()+')',
109  inv(dt.dimensions()),
110  inv(dt.value())
111  );
112 }
113 
114 
116 {
117  return dimensionedSymmTensor
118  (
119  "symm("+dt.name()+')',
120  dt.dimensions(),
121  symm(dt.value())
122  );
123 }
124 
126 {
127  return dimensionedSymmTensor
128  (
129  "twoSymm("+dt.name()+')',
130  dt.dimensions(),
131  twoSymm(dt.value())
132  );
133 }
134 
136 {
137  return dimensionedTensor
138  (
139  "skew("+dt.name()+')',
140  dt.dimensions(),
141  skew(dt.value())
142  );
143 }
144 
145 
147 {
148  return dimensionedVector
149  (
150  "eigenValues("+dt.name()+')',
151  dt.dimensions(),
152  eigenValues(dt.value())
153  );
154 }
155 
156 
158 {
159  return dimensionedTensor
160  (
161  "eigenVectors("+dt.name()+')',
162  dimless,
163  eigenVectors(dt.value())
164  );
165 }
166 
167 
169 {
170  return dimensionedVector
171  (
172  "eigenValues("+dt.name()+')',
173  dt.dimensions(),
174  eigenValues(dt.value())
175  );
176 }
177 
178 
180 {
181  return dimensionedTensor
182  (
183  "eigenVectors("+dt.name()+')',
184  dimless,
185  eigenVectors(dt.value())
186  );
187 }
188 
189 
190 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
191 
193 {
194  return dimensionedVector
195  (
196  "*"+dt.name(),
197  dt.dimensions(),
198  *dt.value()
199  );
200 }
201 
202 
204 {
205  return dimensionedTensor
206  (
207  "*"+dv.name(),
208  dv.dimensions(),
209  *dv.value()
210  );
211 }
212 
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 } // End namespace Foam
217 
218 // ************************************************************************* //
tmp< fvMatrix< Type > > operator*(const volScalarField::Internal &, const fvMatrix< Type > &)
dimensionedTensor skew(const dimensionedTensor &dt)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensionedVector eigenValues(const dimensionedTensor &dt)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
const dimensionSet dimless
Generic dimensioned Type class.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
const Type & value() const
Return const reference to value.
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
dimensioned< tensor > dimensionedTensor
Dimensioned tensor obtained from generic dimensioned type.
dimensioned< Type > T() const
Return transpose.
const word & name() const
Return const reference to name.
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
dimensionedTensor eigenVectors(const dimensionedTensor &dt)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet & dimensions() const
Return const reference to dimensions.
static const direction dim
Dimensionality of space.
Definition: VectorSpace.H:96
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
Namespace for OpenFOAM.