Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
OpenFOAM
fields
Fields
symmTransformField
symmTransformField.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) 1991-2010 OpenCFD Ltd.
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
\*---------------------------------------------------------------------------*/
25
26
#include "
symmTransformField.H
"
27
#include <
OpenFOAM/FieldM.H
>
28
29
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30
31
namespace
Foam
32
{
33
34
// * * * * * * * * * * * * * * * global functions * * * * * * * * * * * * * //
35
36
template
<
class
Type>
37
void
transform
38
(
39
Field<Type>
& rtf,
40
const
symmTensorField
& trf,
41
const
Field<Type>
&
tf
42
)
43
{
44
if
(trf.
size
() == 1)
45
{
46
return
transform
(rtf, trf[0], tf);
47
}
48
else
49
{
50
TFOR_ALL_F_OP_FUNC_F_F
51
(
52
Type, rtf, =,
transform
,
symmTensor
, trf, Type, tf
53
)
54
}
55
}
56
57
58
template
<
class
Type>
59
tmp<Field<Type> >
transform
60
(
61
const
symmTensorField
& trf,
62
const
Field<Type>
& tf
63
)
64
{
65
tmp<Field<Type>
> tranf(
new
Field<Type>
(tf.
size
()));
66
transform
(tranf(), trf, tf);
67
return
tranf;
68
}
69
70
71
template
<
class
Type>
72
tmp<Field<Type> >
transform
73
(
74
const
symmTensorField
& trf,
75
const
tmp
<
Field<Type>
>& ttf
76
)
77
{
78
tmp<Field<Type>
> tranf =
reuseTmp<Type, Type>::New
(ttf);
79
transform
(tranf(), trf, ttf());
80
reuseTmp<Type, Type>::clear
(ttf);
81
return
tranf;
82
}
83
84
85
template
<
class
Type>
86
tmp<Field<Type> >
transform
87
(
88
const
tmp<symmTensorField>
& ttrf,
89
const
Field<Type>
& tf
90
)
91
{
92
tmp<Field<Type>
> tranf(
new
Field<Type>
(tf.
size
()));
93
transform
(tranf(), ttrf(), tf);
94
ttrf.
clear
();
95
return
tranf;
96
}
97
98
99
template
<
class
Type>
100
tmp<Field<Type> >
transform
101
(
102
const
tmp<symmTensorField>
& ttrf,
103
const
tmp
<
Field<Type>
>& ttf
104
)
105
{
106
tmp<Field<Type>
> tranf =
reuseTmp<Type, Type>::New
(ttf);
107
transform
(tranf(), ttrf(), ttf());
108
reuseTmp<Type, Type>::clear
(ttf);
109
ttrf.
clear
();
110
return
tranf;
111
}
112
113
114
template
<
class
Type>
115
void
transform
116
(
117
Field<Type>
& rtf,
118
const
symmTensor
& t,
119
const
Field<Type>
& tf
120
)
121
{
122
TFOR_ALL_F_OP_FUNC_S_F
(Type, rtf, =,
transform
,
tensor
, t, Type, tf)
123
}
124
125
126
template
<
class
Type>
127
tmp<Field<Type> >
transform
128
(
129
const
symmTensor
& t,
130
const
Field<Type>
& tf
131
)
132
{
133
tmp<Field<Type>
> tranf(
new
Field<Type>
(tf.
size
()));
134
transform
(tranf(), t, tf);
135
return
tranf;
136
}
137
138
139
template
<
class
Type>
140
tmp<Field<Type> >
transform
141
(
142
const
symmTensor
& t,
143
const
tmp
<
Field<Type>
>& ttf
144
)
145
{
146
tmp<Field<Type>
> tranf =
reuseTmp<Type, Type>::New
(ttf);
147
transform
(tranf(), t, ttf());
148
reuseTmp<Type, Type>::clear
(ttf);
149
return
tranf;
150
}
151
152
153
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155
}
// End namespace Foam
156
157
// ************************ vim: set sw=4 sts=4 et: ************************ //