symmTensorFieldField.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::symmTensorFieldField
29 
30 Description
31  Specialisation of FieldField<T> for symmTensor.
32 
33 SourceFiles
34  symmTensorFieldField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_symmTensorFieldField_H
39 #define Foam_symmTensorFieldField_H
40 
41 #include "FieldField.H"
42 #include "symmTensor.H"
43 
44 #define TEMPLATE template<template<class> class Field>
45 #include "FieldFieldFunctionsM.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
53 
54 //- Zip together symmTensor field field from components
55 template<template<class> class Field, class Cmpt>
56 void zip
57 (
58  FieldField<Field, SymmTensor<Cmpt>>& result,
59  const FieldField<Field, Cmpt>& xx,
60  const FieldField<Field, Cmpt>& xy,
61  const FieldField<Field, Cmpt>& xz,
62  const FieldField<Field, Cmpt>& yy,
63  const FieldField<Field, Cmpt>& yz,
64  const FieldField<Field, Cmpt>& zz
65 );
66 
67 //- Unzip symmTensor field field into components
68 template<template<class> class Field, class Cmpt>
69 void unzip
70 (
71  const FieldField<Field, SymmTensor<Cmpt>>& input,
72  FieldField<Field, Cmpt>& xx,
73  FieldField<Field, Cmpt>& xy,
74  FieldField<Field, Cmpt>& xz,
75  FieldField<Field, Cmpt>& yy,
76  FieldField<Field, Cmpt>& yz,
77  FieldField<Field, Cmpt>& zz
78 );
79 
80 //- Zip together symmTensor field field from row components
81 template<template<class> class Field, class Cmpt>
82 void zipRows
83 (
84  FieldField<Field, SymmTensor<Cmpt>>& result,
85  const FieldField<Field, Vector<Cmpt>>& x,
86  const FieldField<Field, Vector<Cmpt>>& y,
87  const FieldField<Field, Vector<Cmpt>>& z
88 );
89 
90 //- Zip together symmTensor field from column components
91 template<template<class> class Field, class Cmpt>
92 void zipCols
93 (
94  FieldField<Field, SymmTensor<Cmpt>>& result,
95  const FieldField<Field, Vector<Cmpt>>& x,
96  const FieldField<Field, Vector<Cmpt>>& y,
97  const FieldField<Field, Vector<Cmpt>>& z
98 );
99 
100 
101 //- Extract symmTensor field field rows
102 template<template<class> class Field, class Cmpt>
103 void unzipRows
104 (
105  const FieldField<Field, SymmTensor<Cmpt>>& input,
106  FieldField<Field, Vector<Cmpt>>& x,
107  FieldField<Field, Vector<Cmpt>>& y,
108  FieldField<Field, Vector<Cmpt>>& z
109 );
110 
111 //- Extract symmTensor field field columns
112 template<template<class> class Field, class Cmpt>
113 void unzipCols
114 (
115  const FieldField<Field, SymmTensor<Cmpt>>& input,
116  FieldField<Field, Vector<Cmpt>>& x,
117  FieldField<Field, Vector<Cmpt>>& y,
118  FieldField<Field, Vector<Cmpt>>& z
119 );
120 
121 
122 //- Extract a symmTensor field field row (x,y,z) == (0,1,2)
123 template<template<class> class Field, class Cmpt>
124 void unzipRow
125 (
126  const FieldField<Field, SymmTensor<Cmpt>>& input,
127  const direction idx,
128  FieldField<Field, Vector<Cmpt>>& result
129 );
130 
131 //- Extract a symmTensor field field column (x,y,z) == (0,1,2)
132 template<template<class> class Field, class Cmpt>
133 void unzipCol
134 (
135  const FieldField<Field, SymmTensor<Cmpt>>& input,
136  const direction idx,
137  FieldField<Field, Vector<Cmpt>>& result
138 );
139 
140 //- Extract a symmTensor field field diagonal
141 template<template<class> class Field, class Cmpt>
142 void unzipDiag
143 (
144  const FieldField<Field, SymmTensor<Cmpt>>& input,
145  FieldField<Field, Vector<Cmpt>>& result
146 );
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
153 
154 UNARY_FUNCTION(scalar, symmTensor, tr)
162 UNARY_FUNCTION(scalar, symmTensor, det)
165 
166 
167 // * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
168 
170 
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #include "undefFieldFunctionsM.H"
182 
183 #ifdef NoRepository
184  #include "symmTensorFieldField.C"
185 #endif
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
uint8_t direction
Definition: direction.H:46
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:33
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)
Macro functions for FieldField<Type> algebra.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
#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