GeometricTensorField.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::GeometricTensorField
29 
30 Description
31  Tensor specific part of the implementation of GeometricField.
32 
33 SourceFiles
34  GeometricTensorField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_GeometricTensorField_H
39 #define Foam_GeometricTensorField_H
40 
43 #include "DimensionedTensorField.H"
44 
45 #define TEMPLATE template<template<class> class PatchField, class GeoMesh>
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
54 
55 //- Zip together tensor field from components
56 template<class Cmpt, template<class> class PatchField, class GeoMesh>
57 void zip
58 (
59  GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& result,
60  const GeometricField<Cmpt, PatchField, GeoMesh>& xx,
61  const GeometricField<Cmpt, PatchField, GeoMesh>& xy,
62  const GeometricField<Cmpt, PatchField, GeoMesh>& xz,
63  const GeometricField<Cmpt, PatchField, GeoMesh>& yx,
64  const GeometricField<Cmpt, PatchField, GeoMesh>& yy,
65  const GeometricField<Cmpt, PatchField, GeoMesh>& yz,
66  const GeometricField<Cmpt, PatchField, GeoMesh>& zx,
67  const GeometricField<Cmpt, PatchField, GeoMesh>& zy,
68  const GeometricField<Cmpt, PatchField, GeoMesh>& zz
69 );
70 
71 //- Unzip tensor field into components
72 template<class Cmpt, template<class> class PatchField, class GeoMesh>
73 void unzip
74 (
75  const GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& input,
76  GeometricField<Cmpt, PatchField, GeoMesh>& xx,
77  GeometricField<Cmpt, PatchField, GeoMesh>& xy,
78  GeometricField<Cmpt, PatchField, GeoMesh>& xz,
79  GeometricField<Cmpt, PatchField, GeoMesh>& yx,
80  GeometricField<Cmpt, PatchField, GeoMesh>& yy,
81  GeometricField<Cmpt, PatchField, GeoMesh>& yz,
82  GeometricField<Cmpt, PatchField, GeoMesh>& zx,
83  GeometricField<Cmpt, PatchField, GeoMesh>& zy,
84  GeometricField<Cmpt, PatchField, GeoMesh>& zz
85 );
86 
87 
88 //- Zip together tensor field from row components
89 template<class Cmpt, template<class> class PatchField, class GeoMesh>
90 void zipRows
91 (
92  GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& result,
93  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& x,
94  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& y,
95  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& z
96 );
97 
98 //- Zip together tensor field from column components
99 template<class Cmpt, template<class> class PatchField, class GeoMesh>
100 void zipCols
101 (
102  GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& result,
103  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& x,
104  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& y,
105  const GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& z
106 );
107 
108 //- Extract tensor field rows
109 template<class Cmpt, template<class> class PatchField, class GeoMesh>
110 void unzipRows
111 (
112  const GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& input,
113  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& x,
114  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& y,
115  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& z
116 );
117 
118 //- Extract tensor field columns
119 template<class Cmpt, template<class> class PatchField, class GeoMesh>
120 void unzipCols
121 (
122  const GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& input,
123  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& x,
124  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& y,
125  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& z
126 );
127 
128 
129 //- Extract a tensor field row (x,y,z) == (0,1,2)
130 template<class Cmpt, template<class> class PatchField, class GeoMesh>
131 void unzipRow
132 (
133  const GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& input,
134  const direction idx,
135  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& result
136 );
137 
138 //- Extract a tensor field column (x,y,z) == (0,1,2)
139 template<class Cmpt, template<class> class PatchField, class GeoMesh>
140 void unzipCol
141 (
142  const GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& input,
143  const direction idx,
144  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& result
145 );
146 
147 //- Extract a tensor field diagonal
148 template<class Cmpt, template<class> class PatchField, class GeoMesh>
149 void unzipDiag
150 (
151  const GeometricField<Tensor<Cmpt>, PatchField, GeoMesh>& input,
152  GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& result
153 );
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
171 
174 
175 
176 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
177 
180 
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #include "undefFieldFunctionsM.H"
192 
193 #ifdef NoRepository
194  #include "GeometricTensorField.C"
195 #endif
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
dimensionedScalar sign(const dimensionedScalar &ds)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
void divide(DimensionedField< Type, GeoMesh > &result, const DimensionedField< Type, GeoMesh > &f1, const DimensionedField< scalar, GeoMesh > &f2)
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)
dimensionedTensor skew(const dimensionedTensor &dt)
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.
Tensor specific part of the implementation of DimensionedField.
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
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
SymmTensor specific part of the implementation of GeometricField.
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 > &)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
SphericalTensor specific part of the implementation of GeometricField.
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