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 Foam_transformField_H
39 #define Foam_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 // transformFieldMask()
181 
182 template<class Type1, class Type2>
183 tmp<Field<Type1>> transformFieldMask(const Field<Type2>& fld);
184 
185 template<class Type1, class Type2>
186 tmp<Field<Type1>> transformFieldMask(const tmp<Field<Type2>>& tfld);
187 
188 
189 // Specializations
190 
191 template<>
192 tmp<Field<symmTensor>>
194 
195 template<>
196 tmp<Field<symmTensor>>
197 transformFieldMask<symmTensor>(const tmp<tensorField>&);
198 
199 template<>
200 tmp<Field<sphericalTensor>>
202 
203 template<>
204 tmp<Field<sphericalTensor>>
205 transformFieldMask<sphericalTensor>(const tmp<tensorField>&);
206 
207 
208 //- Rotate given vectorField with the given quaternion
209 void transform(vectorField&, const quaternion&, const vectorField&);
210 
211 //- Rotate given vectorField with the given quaternion
212 tmp<vectorField> transform(const quaternion&, const vectorField&);
213 
214 //- Rotate given tmp<vectorField> with the given quaternion
215 tmp<vectorField> transform(const quaternion&, const tmp<vectorField>&);
216 
217 
218 //- Transform given vectorField of coordinates with the given septernion
219 void transformPoints(vectorField&, const septernion&, const vectorField&);
220 
221 //- Transform given vectorField of coordinates with the given septernion
222 tmp<vectorField> transformPoints(const septernion&, const vectorField&);
223 
224 //- Transform given tmp<vectorField> of coordinates with the given septernion
225 tmp<vectorField> transformPoints(const septernion&, const tmp<vectorField>&);
226 
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 } // End namespace Foam
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 #ifdef NoRepository
235  #include "transformFieldTemplates.C"
236 #endif
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 #endif
241 
242 // ************************************************************************* //
dimensionSet invTransform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:527
void transformPoints(vectorField &, const septernion &, const vectorField &)
Transform given vectorField of coordinates with the given septernion.
Tensor< scalar > tensor
Definition: symmTensor.H:57
tmp< Field< Type1 > > transformFieldMask(const Field< Type2 > &fld)
tmp< Field< sphericalTensor > > transformFieldMask< sphericalTensor >(const tensorField &tf)
3D tensor transformation operations.
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))
Field< tensor > tensorField
Specialisation of Field<T> for tensor.
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
Definition: dimensionSet.C:521
tmp< Field< symmTensor > > transformFieldMask< symmTensor >(const tensorField &tf)
Namespace for OpenFOAM.