dimensionedSymmTensor.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 | Copyright (C) 2011-2015 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 "dimensionedSymmTensor.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32 
33 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
34 
35 template<>
37 {
39  (
40  name()+".T()",
41  dimensions(),
42  value().T()
43  );
44 }
45 
46 
47 // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
48 
50 {
52  (
53  "sqr("+dv.name()+')',
54  sqr(dv.dimensions()),
55  sqr(dv.value())
56  );
57 }
58 
59 
61 {
63  (
64  "innerSqr("+dt.name()+')',
65  sqr(dt.dimensions()),
66  innerSqr(dt.value())
67  );
68 }
69 
70 
72 {
73  return dimensionedScalar
74  (
75  "tr("+dt.name()+')',
76  dt.dimensions(),
77  tr(dt.value())
78  );
79 }
80 
81 
83 {
85  (
86  "symm("+dt.name()+')',
87  dt.dimensions(),
88  symm(dt.value())
89  );
90 }
91 
92 
94 {
96  (
97  "twoSymm("+dt.name()+')',
98  dt.dimensions(),
99  twoSymm(dt.value())
100  );
101 }
102 
103 
105 {
106  return dimensionedSymmTensor
107  (
108  "dev("+dt.name()+')',
109  dt.dimensions(),
110  dev(dt.value())
111  );
112 }
113 
114 
116 {
117  return dimensionedSymmTensor
118  (
119  "dev2("+dt.name()+')',
120  dt.dimensions(),
121  dev2(dt.value())
122  );
123 }
124 
125 
127 {
128  return dimensionedScalar
129  (
130  "det("+dt.name()+')',
132  det(dt.value())
133  );
134 }
135 
136 
138 {
139  return dimensionedSymmTensor
140  (
141  "cof("+dt.name()+')',
142  pow(dt.dimensions(), symmTensor::dim - 1),
143  cof(dt.value())
144  );
145 }
146 
147 
149 {
150  return dimensionedSymmTensor
151  (
152  "inv("+dt.name()+')',
153  dimless/dt.dimensions(),
154  inv(dt.value())
155  );
156 }
157 
158 
159 // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
160 
162 {
163  return dimensionedVector
164  (
165  "*"+dt.name(),
166  dt.dimensions(),
167  *dt.value()
168  );
169 }
170 
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 } // End namespace Foam
175 
176 // ************************************************************************* //
tmp< fvMatrix< Type > > operator*(const DimensionedField< scalar, volMesh > &, const fvMatrix< Type > &)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor innerSqr(const dimensionedSymmTensor &dt)
Namespace for OpenFOAM.
const dimensionSet & dimensions() const
Return const reference to dimensions.
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
Generic dimensioned Type class.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
const word & name() const
Return const reference to name.
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensioned< Type > T() const
Return transpose.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const Type & value() const
Return const reference to value.