symmTensorFieldField.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2015 OpenFOAM Foundation
9 Copyright (C) 2019-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
28
30
31#define TEMPLATE template<template<class> class Field>
33
34// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
35
36template<template<class> class Field, class Cmpt>
38(
46)
47{
48 forAll(result, i)
49 {
51 (
52 result[i],
53 xx[i], xy[i], xz[i],
54 /*yx*/ yy[i], yz[i],
55 /*zx zy */ zz[i]
56 );
57 }
58}
59
60
61template<template<class> class Field, class Cmpt>
63(
64 const FieldField<Field, SymmTensor<Cmpt>>& input,
71)
72{
73 forAll(input, i)
74 {
76 (
77 input[i],
78 xx[i], xy[i], xz[i],
79 /*yx*/ yy[i], yz[i],
80 /*zx zy */ zz[i]
81 );
82 }
83}
84
85
86template<template<class> class Field, class Cmpt>
88(
93)
94{
95 forAll(result, i)
96 {
97 Foam::zipRows(result[i], x[i], y[i], z[i]);
98 }
99}
100
101
102template<template<class> class Field, class Cmpt>
104(
108 const FieldField<Field, Vector<Cmpt>>& z
109)
110{
111 forAll(result, i)
112 {
113 Foam::zipCols(result[i], x[i], y[i], z[i]);
114 }
115}
116
117
118template<template<class> class Field, class Cmpt>
120(
121 const FieldField<Field, SymmTensor<Cmpt>>& input,
125)
126{
127 forAll(input, i)
128 {
129 Foam::unzipRows(input[i], x[i], y[i], z[i]);
130 }
131}
132
133
134template<template<class> class Field, class Cmpt>
136(
137 const FieldField<Field, SymmTensor<Cmpt>>& input,
141)
142{
143 forAll(input, i)
144 {
145 Foam::unzipCols(input[i], x[i], y[i], z[i]);
146 }
147}
148
149
150template<template<class> class Field, class Cmpt>
152(
153 const FieldField<Field, SymmTensor<Cmpt>>& input,
154 const direction idx,
156)
157{
158 forAll(input, i)
159 {
160 Foam::unzipRow(input[i], idx, result[i]);
161 }
162}
163
164
165template<template<class> class Field, class Cmpt>
167(
168 const FieldField<Field, SymmTensor<Cmpt>>& input,
169 const direction idx,
171)
172{
173 forAll(input, i)
174 {
175 Foam::unzipCol(input[i], idx, result[i]);
176 }
177}
178
179
180template<template<class> class Field, class Cmpt>
182(
183 const FieldField<Field, SymmTensor<Cmpt>>& input,
185)
186{
187 forAll(input, i)
188 {
189 Foam::unzipDiag(input[i], result[i]);
190 }
191}
192
193
194// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195
196namespace Foam
197{
198
199// * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
200
203
213
214
215// * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
216
218
221
222
223// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224
225} // End namespace Foam
226
227// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228
229#include "undefFieldFunctionsM.H"
230
231// ************************************************************************* //
#define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define UNARY_OPERATOR(ReturnType, Type1, Op, OpFunc, Dfunc)
#define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)
#define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)
scalar y
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:80
Generic templated field type.
Definition: Field.H:82
A templated (3 x 3) symmetric tensor of objects of <T>, effectively containing 6 elements,...
Definition: SymmTensor.H:57
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:65
Tensor of scalars, i.e. Tensor<scalar>.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Namespace for OpenFOAM.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
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.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
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.
void unzipDiag(const FieldField< Field, SymmTensor< Cmpt > > &input, FieldField< Field, Vector< Cmpt > > &result)
Extract a symmTensor field field diagonal.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition: symmTensor.H:59
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &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 cof(const dimensionedSymmTensor &dt)
void hdual(pointPatchField< vector > &, const pointPatchField< tensor > &)
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a DiagTensor as a SphericalTensor.
Definition: DiagTensorI.H:130
uint8_t direction
Definition: direction.H:56
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 unzip(const FieldField< Field, SphericalTensor< Cmpt > > &input, FieldField< Field, Cmpt > &ii)
Unzip sphericalTensor field field into components.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor innerSqr(const dimensionedSymmTensor &dt)
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)
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.
void zip(FieldField< Field, SphericalTensor< Cmpt > > &result, const FieldField< Field, Cmpt > &ii)
Zip together sphericalTensor field field from components.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
Specialisation of FieldField<T> for symmTensor.