transformField.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) 2018 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 InNamespace
28  Foam
29 
30 Description
31  Spatial transformation functions for primitive fields.
32 
33 SourceFiles
34  transformField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef transformField_H
39 #define transformField_H
40 
41 #include "transform.H"
42 #include "quaternion.H"
43 #include "septernion.H"
44 #include "vectorField.H"
45 #include "tensorField.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 // transform()
55 
56 template<class Type>
57 void transform
58 (
59  Field<Type>& result,
60  const tensor& rot,
61  const Field<Type>& fld
62 );
63 
64 template<class Type>
65 void transform
66 (
67  Field<Type>& result,
68  const tensorField& rot,
69  const Field<Type>& fld
70 );
71 
72 
73 template<class Type>
74 tmp<Field<Type>> transform
75 (
76  const tensorField& rot,
77  const Field<Type>& fld
78 );
79 
80 template<class Type>
81 tmp<Field<Type>> transform
82 (
83  const tensorField& rot,
84  const tmp<Field<Type>>& tfld
85 );
86 
87 template<class Type>
88 tmp<Field<Type>> transform
89 (
90  const tmp<tensorField>& trot,
91  const Field<Type>& fld
92 );
93 
94 template<class Type>
95 tmp<Field<Type>> transform
96 (
97  const tmp<tensorField>& trot,
98  const tmp<Field<Type>>& tfld
99 );
100 
101 
102 template<class Type>
103 tmp<Field<Type>> transform
104 (
105  const tensor& rot,
106  const Field<Type>& fld
107 );
108 
109 template<class Type>
110 tmp<Field<Type>> transform
111 (
112  const tensor& rot,
113  const tmp<Field<Type>>& tfld
114 );
115 
116 
117 // invTransform()
118 
119 template<class Type>
120 void invTransform
121 (
122  Field<Type>& result,
123  const tensor& rot,
124  const Field<Type>& fld
125 );
126 
127 template<class Type>
128 void invTransform
129 (
130  Field<Type>& result,
131  const tensorField& rot,
132  const Field<Type>& fld
133 );
134 
135 
136 template<class Type>
137 tmp<Field<Type>> invTransform
138 (
139  const tensorField& rot,
140  const Field<Type>& fld
141 );
142 
143 template<class Type>
144 tmp<Field<Type>> invTransform
145 (
146  const tensorField& rot,
147  const tmp<Field<Type>>& tfld
148 );
149 
150 template<class Type>
151 tmp<Field<Type>> invTransform
152 (
153  const tmp<tensorField>& trot,
154  const Field<Type>& fld
155 );
156 
157 template<class Type>
158 tmp<Field<Type>> invTransform
159 (
160  const tmp<tensorField>& trot,
161  const tmp<Field<Type>>& tfld
162 );
163 
164 
165 template<class Type>
166 tmp<Field<Type>> invTransform
167 (
168  const tensor& rot,
169  const Field<Type>& fld
170 );
171 
172 template<class Type>
173 tmp<Field<Type>> invTransform
174 (
175  const tensor& rot,
176  const tmp<Field<Type>>& tfld
177 );
178 
179 
180 
181 template<class Type1, class Type2>
182 tmp<Field<Type1>> transformFieldMask(const Field<Type2>& fld);
183 
184 template<class Type1, class Type2>
185 tmp<Field<Type1>> transformFieldMask(const tmp<Field<Type2>>& tfld);
186 
187 
188 // Specializations
189 
190 template<>
191 tmp<Field<symmTensor>>
193 
194 template<>
195 tmp<Field<symmTensor>>
196 transformFieldMask<symmTensor>(const tmp<tensorField>&);
197 
198 template<>
199 tmp<Field<sphericalTensor>>
201 
202 template<>
203 tmp<Field<sphericalTensor>>
204 transformFieldMask<sphericalTensor>(const tmp<tensorField>&);
205 
206 
207 //- Rotate given vectorField with the given quaternion
208 void transform(vectorField&, const quaternion&, const vectorField&);
209 
210 //- Rotate given vectorField with the given quaternion
211 tmp<vectorField> transform(const quaternion&, const vectorField&);
212 
213 //- Rotate given tmp<vectorField> with the given quaternion
214 tmp<vectorField> transform(const quaternion&, const tmp<vectorField>&);
215 
216 
217 //- Transform given vectorField of coordinates with the given septernion
218 void transformPoints(vectorField&, const septernion&, const vectorField&);
219 
220 //- Transform given vectorField of coordinates with the given septernion
221 tmp<vectorField> transformPoints(const septernion&, const vectorField&);
222 
223 //- Transform given tmp<vectorField> of coordinates with the given septernion
224 tmp<vectorField> transformPoints(const septernion&, const tmp<vectorField>&);
225 
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 } // End namespace Foam
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 #ifdef NoRepository
234  #include "transformFieldTemplates.C"
235 #endif
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
Foam::transformFieldMask< symmTensor >
tmp< Field< symmTensor > > transformFieldMask< symmTensor >(const tensorField &tf)
Definition: symmTensorField.C:129
quaternion.H
Foam::tensorField
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
Definition: primitiveFieldsFwd.H:57
Foam::transform
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:519
Foam::vectorField
Field< vector > vectorField
Specialisation of Field<T> for vector.
Definition: primitiveFieldsFwd.H:54
septernion.H
transformFieldTemplates.C
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
Foam::transformPoints
void transformPoints(vectorField &, const septernion &, const vectorField &)
Transform given vectorField of coordinates with the given septernion.
Definition: transformField.C:73
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
tensorField.H
Foam::transformFieldMask
tmp< Field< Type1 > > transformFieldMask(const Field< Type2 > &fld)
vectorField.H
Foam::invTransform
dimensionSet invTransform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:525
transform.H
3D tensor transformation operations.
Foam::transformFieldMask< sphericalTensor >
tmp< Field< sphericalTensor > > transformFieldMask< sphericalTensor >(const tensorField &tf)
Definition: sphericalTensorField.C:52
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61