tensorFieldField.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-2021 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::tensorFieldField
29 
30 Description
31  Specialisation of FieldField<T> for tensor.
32 
33 SourceFiles
34  tensorFieldField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef tensorFieldField_H
39 #define tensorFieldField_H
40 
42 #include "symmTensorFieldField.H"
43 #include "tensor.H"
44 
45 #define TEMPLATE template<template<class> class Field>
46 #include "FieldFieldFunctionsM.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
54 
55 //- Zip together tensor field field from components
56 template<template<class> class Field, class Cmpt>
57 void zip
58 (
59  FieldField<Field, Tensor<Cmpt>>& result,
60  const FieldField<Field, Cmpt>& xx,
61  const FieldField<Field, Cmpt>& xy,
62  const FieldField<Field, Cmpt>& xz,
63  const FieldField<Field, Cmpt>& yx,
64  const FieldField<Field, Cmpt>& yy,
65  const FieldField<Field, Cmpt>& yz,
66  const FieldField<Field, Cmpt>& zx,
67  const FieldField<Field, Cmpt>& zy,
68  const FieldField<Field, Cmpt>& zz
69 );
70 
71 //- Unzip tensor field field into components
72 template<template<class> class Field, class Cmpt>
73 void unzip
74 (
75  const FieldField<Field, Tensor<Cmpt>>& input,
76  FieldField<Field, Cmpt>& xx,
77  FieldField<Field, Cmpt>& xy,
78  FieldField<Field, Cmpt>& xz,
79  FieldField<Field, Cmpt>& yx,
80  FieldField<Field, Cmpt>& yy,
81  FieldField<Field, Cmpt>& yz,
82  FieldField<Field, Cmpt>& zx,
83  FieldField<Field, Cmpt>& zy,
84  FieldField<Field, Cmpt>& zz
85 );
86 
87 
88 //- Zip together tensor field field from row components
89 template<template<class> class Field, class Cmpt>
90 void zipRows
91 (
92  FieldField<Field, Tensor<Cmpt>>& result,
93  const FieldField<Field, Vector<Cmpt>>& x,
94  const FieldField<Field, Vector<Cmpt>>& y,
95  const FieldField<Field, Vector<Cmpt>>& z
96 );
97 
98 //- Zip together tensor field from column components
99 template<template<class> class Field, class Cmpt>
100 void zipCols
101 (
102  FieldField<Field, Tensor<Cmpt>>& result,
103  const FieldField<Field, Vector<Cmpt>>& x,
104  const FieldField<Field, Vector<Cmpt>>& y,
105  const FieldField<Field, Vector<Cmpt>>& z
106 );
107 
108 
109 //- Extract tensor field field rows
110 template<template<class> class Field, class Cmpt>
111 void unzipRows
112 (
113  const FieldField<Field, Tensor<Cmpt>>& input,
114  FieldField<Field, Vector<Cmpt>>& x,
115  FieldField<Field, Vector<Cmpt>>& y,
116  FieldField<Field, Vector<Cmpt>>& z
117 );
118 
119 //- Extract tensor field field columns
120 template<template<class> class Field, class Cmpt>
121 void unzipCols
122 (
123  const FieldField<Field, Tensor<Cmpt>>& input,
124  FieldField<Field, Vector<Cmpt>>& x,
125  FieldField<Field, Vector<Cmpt>>& y,
126  FieldField<Field, Vector<Cmpt>>& z
127 );
128 
129 
130 //- Extract a tensor field field row (x,y,z) == (0,1,2)
131 template<template<class> class Field, class Cmpt>
132 void unzipRow
133 (
134  const FieldField<Field, Tensor<Cmpt>>& input,
135  const vector::components cmpt,
136  FieldField<Field, Vector<Cmpt>>& result
137 );
138 
139 //- Extract a tensor field field column (x,y,z) == (0,1,2)
140 template<template<class> class Field, class Cmpt>
141 void unzipCol
142 (
143  const FieldField<Field, Tensor<Cmpt>>& input,
144  const vector::components cmpt,
145  FieldField<Field, Vector<Cmpt>>& result
146 );
147 
148 //- Extract a tensor field field diagonal
149 template<template<class> class Field, class Cmpt>
150 void unzipDiag
151 (
152  const FieldField<Field, Tensor<Cmpt>>& input,
153  FieldField<Field, Vector<Cmpt>>& result
154 );
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 UNARY_FUNCTION(scalar, tensor, tr)
166 UNARY_FUNCTION(scalar, tensor, det)
169 
172 
173 // * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
174 
177 
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #include "undefFieldFunctionsM.H"
189 
190 #ifdef NoRepository
191  #include "tensorFieldField.C"
192 #endif
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
BINARY_OPERATOR
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Definition: DimensionedFieldFunctionsM.C:412
Foam::symm
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:84
Foam::sphericalTensor
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
Definition: sphericalTensor.H:54
Foam::zipCols
void zipCols(FieldField< Field, Tensor< Cmpt >> &result, const FieldField< Field, Vector< Cmpt >> &x, const FieldField< Field, Vector< Cmpt >> &y, const FieldField< Field, Vector< Cmpt >> &z)
Zip together tensor field from column components.
Definition: tensorFieldField.C:113
UNARY_FUNCTION
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
Definition: DimensionedFieldFunctionsM.C:33
Foam::unzipRows
void unzipRows(const FieldField< Field, Tensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &x, FieldField< Field, Vector< Cmpt >> &y, FieldField< Field, Vector< Cmpt >> &z)
Extract tensor field field rows.
Definition: tensorFieldField.C:129
Foam::unzip
void unzip(const FieldField< Field, SphericalTensor< Cmpt >> &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
Definition: sphericalTensorFieldField.C:55
Foam::skew
dimensionedTensor skew(const dimensionedTensor &dt)
Definition: dimensionedTensor.C:138
Foam::eigenValues
dimensionedVector eigenValues(const dimensionedSymmTensor &dt)
Definition: dimensionedTensor.C:149
Foam::eigenVectors
dimensionedTensor eigenVectors(const dimensionedSymmTensor &dt)
Definition: dimensionedTensor.C:160
BINARY_TYPE_OPERATOR
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
Definition: DimensionedFieldFunctionsM.C:674
undefFieldFunctionsM.H
Foam::unzipRow
void unzipRow(const FieldField< Field, Tensor< Cmpt >> &input, const vector::components cmpt, FieldField< Field, Vector< Cmpt >> &result)
Extract a tensor field field row (x,y,z) == (0,1,2)
Definition: tensorFieldField.C:161
Foam::zipRows
void zipRows(FieldField< Field, Tensor< Cmpt >> &result, const FieldField< Field, Vector< Cmpt >> &x, const FieldField< Field, Vector< Cmpt >> &y, const FieldField< Field, Vector< Cmpt >> &z)
Zip together tensor field field from row components.
Definition: tensorFieldField.C:97
Foam::unzipCols
void unzipCols(const FieldField< Field, Tensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &x, FieldField< Field, Vector< Cmpt >> &y, FieldField< Field, Vector< Cmpt >> &z)
Extract tensor field field columns.
Definition: tensorFieldField.C:145
Foam::dev2
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:117
tensor.H
Foam::Vector< scalar >::components
components
Component labeling enumeration.
Definition: Vector.H:81
Foam::divide
void divide(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, scalar > &f2)
Foam::inv
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:73
sphericalTensorFieldField.H
Specialisation of FieldField<Field, T> for sphericalTensor.
symmTensorFieldField.H
Specialisation of FieldField<T> for symmTensor.
Foam::symmTensor
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition: symmTensor.H:59
Foam::sph
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a DiagTensor as a SphericalTensor.
Definition: DiagTensorI.H:130
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
FieldFieldFunctionsM.H
High performance macro functions for Field<Type> algebra. These expand using either array element acc...
Foam::cof
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:139
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
Foam::unzipCol
void unzipCol(const FieldField< Field, Tensor< Cmpt >> &input, const vector::components cmpt, FieldField< Field, Vector< Cmpt >> &result)
Extract a tensor field field column (x,y,z) == (0,1,2)
Definition: tensorFieldField.C:176
UNARY_OPERATOR
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
Definition: DimensionedFieldFunctionsM.C:87
Foam::input
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:55
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::zip
void zip(FieldField< Field, SphericalTensor< Cmpt >> &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
Definition: sphericalTensorFieldField.C:41
Foam::unzipDiag
void unzipDiag(const FieldField< Field, SymmTensor< Cmpt >> &input, FieldField< Field, Vector< Cmpt >> &result)
Extract a symmTensor field field diagonal.
Definition: symmTensorFieldField.C:91
Foam::tr
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:51
Foam::det
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:62
Foam::hdual
void hdual(pointPatchField< vector > &, const pointPatchField< tensor > &)
Definition: pointPatchFieldFunctions.H:273
tensorFieldField.C
Specialisation of FieldField<T> for tensor.
Foam::twoSymm
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:95
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61
y
scalar y
Definition: LISASMDCalcMethod1.H:14
Foam::dev
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
Definition: dimensionedSymmTensor.C:106