GeometricSymmTensorField.H
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-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2023 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 InClass
28  Foam::GeometricSymmTensorField
29 
30 Description
31  SymmTensor specific part of the implementation of GeometricField.
32 
33 SourceFiles
34  GeometricSymmTensorField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_GeometricSymmTensorField_H
39 #define Foam_GeometricSymmTensorField_H
40 
41 #include "GeometricField.H"
43 
44 #define TEMPLATE template<template<class> class PatchField, class GeoMesh>
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
53 
54 //- Zip together symmTensor field from components
55 template<class Cmpt, template<class> class PatchField, class GeoMesh>
56 void zip
57 (
58  GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& result,
59  const GeometricField<Cmpt, PatchField, GeoMesh>& xx,
60  const GeometricField<Cmpt, PatchField, GeoMesh>& xy,
61  const GeometricField<Cmpt, PatchField, GeoMesh>& xz,
62  const GeometricField<Cmpt, PatchField, GeoMesh>& yy,
63  const GeometricField<Cmpt, PatchField, GeoMesh>& yz,
64  const GeometricField<Cmpt, PatchField, GeoMesh>& zz
65 );
66 
67 //- Unzip symmTensor field into components
68 template<class Cmpt, template<class> class PatchField, class GeoMesh>
69 void unzip
70 (
71  const GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& input,
72  GeometricField<Cmpt, PatchField, GeoMesh>& xx,
73  GeometricField<Cmpt, PatchField, GeoMesh>& xy,
74  GeometricField<Cmpt, PatchField, GeoMesh>& xz,
75  GeometricField<Cmpt, PatchField, GeoMesh>& yy,
76  GeometricField<Cmpt, PatchField, GeoMesh>& yz,
77  GeometricField<Cmpt, PatchField, GeoMesh>& zz
78 );
79 
80 
81 //- Zip together symmTensor field from row components
82 template<class Cmpt, template<class> class PatchField, class GeoMesh>
83 void zipRows
84 (
85  GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& result,
86  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& x,
87  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& y,
88  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& z
89 );
90 
91 //- Zip together symmTensor field from column components
92 template<class Cmpt, template<class> class PatchField, class GeoMesh>
93 void zipCols
94 (
95  GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& result,
96  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& x,
97  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& y,
98  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& z
99 );
100 
101 //- Extract symmTensor field rows
102 template<class Cmpt, template<class> class PatchField, class GeoMesh>
103 void unzipRows
104 (
105  const GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& input,
106  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& x,
107  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& y,
108  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& z
109 );
110 
111 //- Extract symmTensor field columns
112 template<class Cmpt, template<class> class PatchField, class GeoMesh>
113 void unzipCols
114 (
115  const GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& input,
116  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& x,
117  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& y,
118  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& z
119 );
120 
121 
122 //- Extract a symmTensor field row (x,y,z) == (0,1,2)
123 template<class Cmpt, template<class> class PatchField, class GeoMesh>
124 void unzipRow
125 (
126  const GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& input,
127  const direction idx,
128  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& result
129 );
130 
131 //- Extract a symmTensor field column (x,y,z) == (0,1,2)
132 template<class Cmpt, template<class> class PatchField, class GeoMesh>
133 void unzipCol
134 (
135  const GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& input,
136  const direction idx,
137  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& result
138 );
139 
140 
141 //- Extract a symmTensor field diagonal
142 template<class Cmpt, template<class> class PatchField, class GeoMesh>
143 void unzipDiag
144 (
145  const GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& input,
146  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& result
147 );
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
154 
166 
167 
168 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
169 
171 
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #include "undefFieldFunctionsM.H"
183 
184 #ifdef NoRepository
185  #include "GeometricSymmTensorField.C"
186 #endif
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
uint8_t direction
Definition: direction.H:48
void unzipCols(const FieldField< Field, SymmTensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &x, FieldField< Field, Vector< Cmpt >> &y, FieldField< Field, Vector< Cmpt >> &z)
Extract symmTensor field field columns.
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
void zip(FieldField< Field, SphericalTensor< Cmpt >> &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
void zipCols(FieldField< Field, SymmTensor< Cmpt >> &result, const FieldField< Field, Vector< Cmpt >> &x, const FieldField< Field, Vector< Cmpt >> &y, const FieldField< Field, Vector< Cmpt >> &z)
Zip together symmTensor field from column components.
Tensor< scalar > tensor
Definition: symmTensor.H:57
void unzipRow(const FieldField< Field, SymmTensor< Cmpt >> &input, const direction idx, FieldField< Field, Vector< Cmpt >> &result)
Extract a symmTensor field field row (x,y,z) == (0,1,2)
SymmTensor< Cmpt > devSymm(const SymmTensor< Cmpt > &st)
Return the deviatoric part of the symmetric part of a SymmTensor.
Definition: SymmTensorI.H:481
dimensionedScalar det(const dimensionedSphericalTensor &dt)
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a DiagTensor as a SphericalTensor.
Definition: DiagTensorI.H:110
void unzipRows(const FieldField< Field, SymmTensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &x, FieldField< Field, Vector< Cmpt >> &y, FieldField< Field, Vector< Cmpt >> &z)
Extract symmTensor field field rows.
void zipRows(FieldField< Field, SymmTensor< Cmpt >> &result, const FieldField< Field, Vector< Cmpt >> &x, const FieldField< Field, Vector< Cmpt >> &y, const FieldField< Field, Vector< Cmpt >> &z)
Zip together symmTensor field field from row components.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void unzip(const FieldField< Field, SphericalTensor< Cmpt >> &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
void unzipDiag(const FieldField< Field, SymmTensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &result)
Extract a symmTensor field field diagonal.
scalar y
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition: symmTensor.H:55
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:47
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
Vector< scalar > vector
Definition: vector.H:57
void hdual(pointPatchField< vector > &, const pointPatchField< tensor > &)
dimensionedSymmTensor innerSqr(const dimensionedSymmTensor &dt)
void unzipCol(const FieldField< Field, SymmTensor< Cmpt >> &input, const direction idx, FieldField< Field, Vector< Cmpt >> &result)
Extract a symmTensor field field column (x,y,z) == (0,1,2)
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
SymmTensor specific part of the implementation of DimensionedField.
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:521
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
Namespace for OpenFOAM.
SymmTensor< Cmpt > devTwoSymm(const SymmTensor< Cmpt > &st)
Return the deviatoric part of twice the symmetric part of a SymmTensor.
Definition: SymmTensorI.H:491