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 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(rtf.internalField(), trf.internalField(), tf.internalField());
49  transform(rtf.boundaryField(), trf.boundaryField(), tf.boundaryField());
50 }
51 
52 
53 template<class Type, template<class> class PatchField, class GeoMesh>
54 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
55 (
58 )
59 {
61  (
63  (
64  IOobject
65  (
66  "transform(" + trf.name() + ',' + tf.name() + ')',
67  tf.instance(),
68  tf.db(),
71  ),
72  tf.mesh(),
73  tf.dimensions()
74  )
75  );
76 
77  transform(tranf(), trf, tf);
78 
79  return tranf;
80 }
81 
82 
83 template<class Type, template<class> class PatchField, class GeoMesh>
84 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
85 (
88 )
89 {
91  transform(trf, ttf());
92  ttf.clear();
93  return tranf;
94 }
95 
96 
97 template<class Type, template<class> class PatchField, class GeoMesh>
98 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
99 (
102 )
103 {
105  transform(ttrf(), tf);
106  ttrf.clear();
107  return tranf;
108 }
109 
110 
111 template<class Type, template<class> class PatchField, class GeoMesh>
112 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
113 (
116 )
117 {
119  transform(ttrf(), ttf());
120  ttf.clear();
121  ttrf.clear();
122  return tranf;
123 }
124 
125 
126 template<class Type, template<class> class PatchField, class GeoMesh>
127 void transform
128 (
130  const dimensionedTensor& t,
132 )
133 {
134  transform(rtf.internalField(), t.value(), tf.internalField());
135  transform(rtf.boundaryField(), t.value(), tf.boundaryField());
136 }
137 
138 
139 template<class Type, template<class> class PatchField, class GeoMesh>
140 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
141 (
142  const dimensionedTensor& t,
144 )
145 {
147  (
149  (
150  IOobject
151  (
152  "transform(" + t.name() + ',' + tf.name() + ')',
153  tf.instance(),
154  tf.db(),
157  ),
158  tf.mesh(),
159  tf.dimensions()
160  )
161  );
162 
163  transform(tranf(), t, tf);
164 
165  return tranf;
166 }
167 
168 
169 template<class Type, template<class> class PatchField, class GeoMesh>
170 tmp<GeometricField<Type, PatchField, GeoMesh> > transform
171 (
172  const dimensionedTensor& t,
174 )
175 {
177  transform(t, ttf());
178  ttf.clear();
179  return tranf;
180 }
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
transformGeometricField.H
Spatial transformation functions for FieldFields.
Foam::dimensioned::name
const word & name() const
Return const reference to name.
Definition: dimensionedType.C:235
Foam::GeometricField::boundaryField
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Definition: GeometricField.C:735
Foam::dimensioned::value
const Type & value() const
Return const reference to value.
Definition: dimensionedType.C:261
transformField.H
Spatial transformation functions for primitive fields.
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition: IOobject.H:118
Foam::transform
dimensionSet transform(const dimensionSet &)
Definition: dimensionSet.C:465
tf
const tensorField & tf
Definition: getPatchFieldTensor.H:36
Foam::IOobject::NO_READ
@ NO_READ
Definition: IOobject.H:111
transformFieldField.H
transformFieldField Spatial transformation functions for FieldField.
Foam::GeometricField::internalField
InternalField & internalField()
Return internal field.
Definition: GeometricField.C:724
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52