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