transformGeometricField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 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  "transform(" + trf.name() + ',' + tf.name() + ')',
75  tf.mesh(),
76  tf.dimensions()
77  )
78  );
79 
80  transform(tranf.ref(), trf, tf);
81 
82  return tranf;
83 }
84 
85 
86 template<class Type, template<class> class PatchField, class GeoMesh>
88 (
91 )
92 {
94  transform(trf, ttf());
95  ttf.clear();
96  return tranf;
97 }
98 
99 
100 template<class Type, template<class> class PatchField, class GeoMesh>
102 (
105 )
106 {
108  transform(ttrf(), tf);
109  ttrf.clear();
110  return tranf;
111 }
112 
113 
114 template<class Type, template<class> class PatchField, class GeoMesh>
116 (
119 )
120 {
122  transform(ttrf(), ttf());
123  ttf.clear();
124  ttrf.clear();
125  return tranf;
126 }
127 
128 
129 template<class Type, template<class> class PatchField, class GeoMesh>
130 void transform
131 (
133  const dimensionedTensor& t,
135 )
136 {
138  transform(rtf.boundaryFieldRef(), t.value(), tf.boundaryField());
139 }
140 
141 
142 template<class Type, template<class> class PatchField, class GeoMesh>
144 (
145  const dimensionedTensor& t,
147 )
148 {
150  (
152  (
153  "transform(" + t.name() + ',' + tf.name() + ')',
154  tf.mesh(),
155  tf.dimensions()
156  )
157  );
158 
159  transform(tranf.ref(), t, tf);
160 
161  return tranf;
162 }
163 
164 
165 template<class Type, template<class> class PatchField, class GeoMesh>
167 (
168  const dimensionedTensor& t,
170 )
171 {
173  transform(t, ttf());
174  ttf.clear();
175  return tranf;
176 }
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // ************************************************************************* //
const word & name() const
Return name.
Definition: IOobject.H:295
Spatial transformation functions for FieldFields.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
T & ref() const
Return non-const reference or generate a fatal error.
Definition: tmpI.H:174
const Internal::FieldType & primitiveField() const
Return a const-reference to the internal field.
Generic GeometricField class.
Generic dimensioned Type class.
const tensorField & tf
Spatial transformation functions for primitive fields.
const dimensionSet & dimensions() const
Return dimensions.
const Type & value() const
Return const reference to value.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
const Mesh & mesh() const
Return mesh.
const word & name() const
Return const reference to name.
Boundary & boundaryFieldRef()
Return a reference to the boundary field.
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:53
Namespace for OpenFOAM.
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:477