transformGeometricField.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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25  Spatial transformation functions for FieldFields.
26 
27 \*---------------------------------------------------------------------------*/
28 
30 #include "transformField.H"
31 #include "transformFieldField.H"
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
38 // * * * * * * * * * * * * * * * global functions * * * * * * * * * * * * * //
39 
40 template<class Type, template<class> class PatchField, class GeoMesh>
41 void transform
42 (
46 )
47 {
48  transform
49  (
50  rtf.primitiveFieldRef(),
51  trf.primitiveField(),
52  tf.primitiveField()
53  );
54  transform
55  (
56  rtf.boundaryFieldRef(),
57  trf.boundaryField(),
58  tf.boundaryField()
59  );
60 }
61 
62 
63 template<class Type, template<class> class PatchField, class GeoMesh>
65 (
68 )
69 {
71  (
73  (
74  IOobject
75  (
76  "transform(" + trf.name() + ',' + tf.name() + ')',
77  tf.instance(),
78  tf.db(),
81  ),
82  tf.mesh(),
83  tf.dimensions()
84  )
85  );
86 
87  transform(tranf.ref(), trf, tf);
88 
89  return tranf;
90 }
91 
92 
93 template<class Type, template<class> class PatchField, class GeoMesh>
95 (
98 )
99 {
101  transform(trf, ttf());
102  ttf.clear();
103  return tranf;
104 }
105 
106 
107 template<class Type, template<class> class PatchField, class GeoMesh>
109 (
112 )
113 {
115  transform(ttrf(), tf);
116  ttrf.clear();
117  return tranf;
118 }
119 
120 
121 template<class Type, template<class> class PatchField, class GeoMesh>
123 (
126 )
127 {
129  transform(ttrf(), ttf());
130  ttf.clear();
131  ttrf.clear();
132  return tranf;
133 }
134 
135 
136 template<class Type, template<class> class PatchField, class GeoMesh>
137 void transform
138 (
140  const dimensionedTensor& t,
142 )
143 {
145  transform(rtf.boundaryFieldRef(), t.value(), tf.boundaryField());
146 }
147 
148 
149 template<class Type, template<class> class PatchField, class GeoMesh>
151 (
152  const dimensionedTensor& t,
154 )
155 {
157  (
159  (
160  IOobject
161  (
162  "transform(" + t.name() + ',' + tf.name() + ')',
163  tf.instance(),
164  tf.db(),
167  ),
168  tf.mesh(),
169  tf.dimensions()
170  )
171  );
172 
173  transform(tranf.ref(), t, tf);
174 
175  return tranf;
176 }
177 
178 
179 template<class Type, template<class> class PatchField, class GeoMesh>
181 (
182  const dimensionedTensor& t,
184 )
185 {
187  transform(t, ttf());
188  ttf.clear();
189  return tranf;
190 }
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // ************************************************************************* //
const objectRegistry & db() const
Return the local objectRegistry.
Definition: IOobject.C:221
Spatial transformation functions for FieldFields.
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
const Type & value() const
Return const reference to value.
Generic GeometricField class.
Generic dimensioned Type class.
const tensorField & tf
const word & name() const
Return const reference to name.
Spatial transformation functions for primitive fields.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
const dimensionSet & dimensions() const
Return dimensions.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
const Mesh & mesh() const
Return mesh.
transformFieldField Spatial transformation functions for FieldField.
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:46
A class for managing temporary objects.
Definition: PtrList.H:54
T & ref() const
Return non-const reference or generate a fatal error.
Definition: tmpI.H:174
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
const fileName & instance() const
Definition: IOobject.H:337
const word & name() const
Return name.
Definition: IOobject.H:260
Namespace for OpenFOAM.
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:465