initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / fields / GeometricFields / GeometricField / GeometricFieldFunctionsM.H
blob40c9a864a157eecb3973998ee6abfb67b7faf938
1 /*---------------------------------------------------------------------------*\
2   =========                 | 
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 #define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc)                        \
30                                                                               \
31 TEMPLATE                                                                      \
32 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
33 (                                                                             \
34     const GeometricField<Type1, PatchField, GeoMesh>& df                      \
35 );                                                                            \
36                                                                               \
37 TEMPLATE                                                                      \
38 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
39 (                                                                             \
40     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1              \
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 #define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc)                  \
47                                                                               \
48 TEMPLATE                                                                      \
49 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
50 (                                                                             \
51     const GeometricField<Type1, PatchField, GeoMesh>& df1                     \
52 );                                                                            \
53                                                                               \
54 TEMPLATE                                                                      \
55 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
56 (                                                                             \
57     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1              \
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 #define BINARY_FUNCTION(ReturnType, Type1, Type2, Func)                       \
64                                                                               \
65 TEMPLATE                                                                      \
66 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
67 (                                                                             \
68     const GeometricField<Type1, PatchField, GeoMesh>& df1,                    \
69     const GeometricField<Type2, PatchField, GeoMesh>& df2                     \
70 );                                                                            \
71                                                                               \
72 TEMPLATE                                                                      \
73 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
74 (                                                                             \
75     const GeometricField<Type1, PatchField, GeoMesh>& df1,                    \
76     const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2              \
77 );                                                                            \
78                                                                               \
79 TEMPLATE                                                                      \
80 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
81 (                                                                             \
82     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1,             \
83     const GeometricField<Type2, PatchField, GeoMesh>& df2                     \
84 );                                                                            \
85                                                                               \
86 TEMPLATE                                                                      \
87 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
88 (                                                                             \
89     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1,             \
90     const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2              \
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 #define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func)               \
97                                                                               \
98 TEMPLATE                                                                      \
99 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
100 (                                                                             \
101     const dimensioned<Type1>& dt1,                                            \
102     const GeometricField<Type2, PatchField, GeoMesh>& df2                     \
103 );                                                                            \
104                                                                               \
105 TEMPLATE                                                                      \
106 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
107 (                                                                             \
108     const Type1& t1,                                                          \
109     const GeometricField<Type2, PatchField, GeoMesh>& df2                     \
110 );                                                                            \
111                                                                               \
112 TEMPLATE                                                                      \
113 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
114 (                                                                             \
115     const dimensioned<Type1>& dt1,                                            \
116     const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2              \
117 );                                                                            \
118                                                                               \
119 TEMPLATE                                                                      \
120 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
121 (                                                                             \
122     const Type1& t1,                                                          \
123     const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2              \
127 #define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)               \
128                                                                               \
129 TEMPLATE                                                                      \
130 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
131 (                                                                             \
132     const GeometricField<Type1, PatchField, GeoMesh>& df1,                    \
133     const dimensioned<Type2>& dt2                                             \
134 );                                                                            \
135                                                                               \
136 TEMPLATE                                                                      \
137 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
138 (                                                                             \
139     const GeometricField<Type1, PatchField, GeoMesh>& df1,                    \
140     const Type2& t2                                                           \
141 );                                                                            \
142                                                                               \
143 TEMPLATE                                                                      \
144 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
145 (                                                                             \
146     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1,             \
147     const dimensioned<Type2>& dt2                                             \
148 );                                                                            \
149                                                                               \
150 TEMPLATE                                                                      \
151 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func                    \
152 (                                                                             \
153     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf2,             \
154     const Type2& t2                                                           \
158 #define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func)                  \
159     BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func)                   \
160     BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 #define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)         \
166                                                                               \
167 TEMPLATE                                                                      \
168 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
169 (                                                                             \
170     const GeometricField<Type1, PatchField, GeoMesh>& df1,                    \
171     const GeometricField<Type2, PatchField, GeoMesh>& df2                     \
172 );                                                                            \
173                                                                               \
174 TEMPLATE                                                                      \
175 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
176 (                                                                             \
177     const GeometricField<Type1, PatchField, GeoMesh>& df1,                    \
178     const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2              \
179 );                                                                            \
180                                                                               \
181 TEMPLATE                                                                      \
182 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
183 (                                                                             \
184     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1,             \
185     const GeometricField<Type2, PatchField, GeoMesh>& df2                     \
186 );                                                                            \
187                                                                               \
188 TEMPLATE                                                                      \
189 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
190 (                                                                             \
191     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1,             \
192     const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2              \
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 #define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
199                                                                               \
200 TEMPLATE                                                                      \
201 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
202 (                                                                             \
203     const dimensioned<Type1>& dt1,                                            \
204     const GeometricField<Type2, PatchField, GeoMesh>& df2                     \
205 );                                                                            \
206                                                                               \
207 TEMPLATE                                                                      \
208 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
209 (                                                                             \
210     const Type1& t1,                                                          \
211     const GeometricField<Type2, PatchField, GeoMesh>& df2                     \
212 );                                                                            \
213                                                                               \
214 TEMPLATE                                                                      \
215 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
216 (                                                                             \
217     const dimensioned<Type1>& dt1,                                            \
218     const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2              \
219 );                                                                            \
220                                                                               \
221 TEMPLATE                                                                      \
222 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
223 (                                                                             \
224     const Type1& t1,                                                          \
225     const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2              \
229 #define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
230                                                                               \
231 TEMPLATE                                                                      \
232 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
233 (                                                                             \
234     const GeometricField<Type1, PatchField, GeoMesh>& df1,                    \
235     const dimensioned<Type2>& dt2                                             \
236 );                                                                            \
237                                                                               \
238 TEMPLATE                                                                      \
239 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
240 (                                                                             \
241     const GeometricField<Type1, PatchField, GeoMesh>& df1,                    \
242     const Type2& t2                                                           \
243 );                                                                            \
244                                                                               \
245 TEMPLATE                                                                      \
246 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
247 (                                                                             \
248     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1,             \
249     const dimensioned<Type2>& dt2                                             \
250 );                                                                            \
251                                                                               \
252 TEMPLATE                                                                      \
253 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op             \
254 (                                                                             \
255     const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1,             \
256     const Type2& t2                                                           \
260 #define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc)    \
261     BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc)     \
262     BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
265 // ************************************************************************* //