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-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
27InClass
28 Foam::GeometricSymmTensorField
29
30Description
31 SymmTensor specific part of the implementation of GeometricField.
32
33SourceFiles
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
49namespace Foam
50{
51
52// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
53
54//- Zip together symmTensor field from components
55template<class Cmpt, template<class> class PatchField, class GeoMesh>
56void 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
68template<class Cmpt, template<class> class PatchField, class GeoMesh>
69void 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
82template<class Cmpt, template<class> class PatchField, class GeoMesh>
83void 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
92template<class Cmpt, template<class> class PatchField, class GeoMesh>
93void 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
102template<class Cmpt, template<class> class PatchField, class GeoMesh>
103void 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
112template<class Cmpt, template<class> class PatchField, class GeoMesh>
113void 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)
123template<class Cmpt, template<class> class PatchField, class GeoMesh>
124void 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)
132template<class Cmpt, template<class> class PatchField, class GeoMesh>
133void 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
142template<class Cmpt, template<class> class PatchField, class GeoMesh>
143void unzipDiag
144(
145 const GeometricField<SymmTensor<Cmpt>, PatchField, GeoMesh>& input,
146 GeometricField<Vector<Cmpt>, PatchField, GeoMesh>& result
147);
148
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
154
164
165
166// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
167
169
172
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176} // End namespace Foam
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180#include "undefFieldFunctionsM.H"
181
182#ifdef NoRepository
184#endif
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188#endif
189
190// ************************************************************************* //
#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)
SymmTensor specific part of the implementation of DimensionedField.
scalar y
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.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:536
void unzipDiag(const FieldField< Field, SymmTensor< Cmpt > > &input, FieldField< Field, Vector< Cmpt > > &result)
Extract a symmTensor field field diagonal.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:55
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.