OpenFOAM
dev
The OpenFOAM Foundation
transformFieldField.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 FieldField.
26
27
\*---------------------------------------------------------------------------*/
28
29
#include "
transformFieldField.H
"
30
31
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
33
namespace
Foam
34
{
35
36
// * * * * * * * * * * * * * * * global functions * * * * * * * * * * * * * //
37
38
template
<
template
<
class
>
class
Field,
class
Type>
39
void
transform
40
(
41
FieldField<Field, Type>
& rtf,
42
const
FieldField<Field, tensor>
& trf,
43
const
FieldField<Field, Type>
&
tf
44
)
45
{
46
forAll
(rtf, i)
47
{
48
transform
(rtf[i], trf[i],
tf
[i]);
49
}
50
}
51
52
53
template
<
template
<
class
>
class
Field,
class
Type>
54
tmp<FieldField<Field, Type>
>
transform
55
(
56
const
FieldField<Field, tensor>
& trf,
57
const
FieldField<Field, Type>
&
tf
58
)
59
{
60
tmp<FieldField<Field, Type>
> tranf
61
(
62
FieldField<Field, Type>::NewCalculatedType
(
tf
)
63
);
64
transform
(tranf(), trf,
tf
);
65
return
tranf;
66
}
67
68
69
template
<
template
<
class
>
class
Field,
class
Type>
70
tmp<FieldField<Field, Type>
>
transform
71
(
72
const
FieldField<Field, tensor>
& trf,
73
const
tmp
<
FieldField<Field, Type>
>& ttf
74
)
75
{
76
tmp<FieldField<Field, Type>
> tranf(ttf.ptr());
77
transform
(tranf(), trf, tranf());
78
return
tranf;
79
}
80
81
82
template
<
template
<
class
>
class
Field,
class
Type>
83
tmp<FieldField<Field, Type>
>
transform
84
(
85
const
tmp
<
FieldField<Field, tensor>
>& ttrf,
86
const
FieldField<Field, Type>
&
tf
87
)
88
{
89
tmp<FieldField<Field, Type>
> tranf
90
(
91
FieldField<Field, Type>::NewCalculatedType
(
tf
)
92
);
93
transform
(tranf(), ttrf(),
tf
);
94
ttrf.clear();
95
return
tranf;
96
}
97
98
99
template
<
template
<
class
>
class
Field,
class
Type>
100
tmp<FieldField<Field, Type>
>
transform
101
(
102
const
tmp
<
FieldField<Field, tensor>
>& ttrf,
103
const
tmp
<
FieldField<Field, Type>
>& ttf
104
)
105
{
106
tmp<FieldField<Field, Type>
> tranf(ttf.ptr());
107
transform
(tranf(), ttrf(), tranf());
108
ttrf.clear();
109
return
tranf;
110
}
111
112
113
template
<
template
<
class
>
class
Field,
class
Type>
114
void
transform
115
(
116
FieldField<Field, Type>
& rtf,
117
const
tensor
& t,
118
const
FieldField<Field, Type>
&
tf
119
)
120
{
121
forAll
(rtf, i)
122
{
123
transform
(rtf[i], t,
tf
[i]);
124
}
125
}
126
127
128
template
<
template
<
class
>
class
Field,
class
Type>
129
tmp<FieldField<Field, Type>
>
transform
130
(
131
const
tensor
& t,
132
const
FieldField<Field, Type>
&
tf
133
)
134
{
135
tmp<FieldField<Field, Type>
> tranf
136
(
137
FieldField<Field, Type>::NewCalculatedType
(
tf
)
138
);
139
transform
(tranf(), t,
tf
);
140
return
tranf;
141
}
142
143
144
template
<
template
<
class
>
class
Field,
class
Type>
145
tmp<FieldField<Field, Type>
>
transform
146
(
147
const
tensor
& t,
148
const
tmp
<
FieldField<Field, Type>
>& ttf
149
)
150
{
151
tmp<FieldField<Field, Type>
> tranf(ttf.ptr());
152
transform
(tranf(), t, tranf());
153
return
tranf;
154
}
155
156
157
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159
}
// End namespace Foam
160
161
// ************************************************************************* //
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition:
UList.H:449
Foam::FieldField
Generic field type.
Definition:
FieldField.H:77
Foam::Tensor< scalar >
Foam::tmp
A class for managing temporary objects.
Definition:
tmp.H:55
tf
const tensorField & tf
Definition:
getPatchFieldTensor.H:36
Foam
Namespace for OpenFOAM.
Definition:
atmosphericBoundaryLayer.C:32
Foam::transform
void transform(GeometricField< Type, GeoMesh > &rtf, const GeometricField< tensor, GeoMesh > &trf, const GeometricField< Type, GeoMesh > &tf)
Definition:
transformGeometricField.C:42
transformFieldField.H
transformFieldField Spatial transformation functions for FieldField.
src
OpenFOAM
fields
FieldFields
transformFieldField
transformFieldField.C
Generated by
1.9.1