1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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
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/>.
24 \*---------------------------------------------------------------------------*/
26 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
28 #define UNARY_FUNCTION(ReturnType, Type1, Func, Dfunc) \
31 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
33 const GeometricField<Type1, PatchField, GeoMesh>& df \
37 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
39 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1 \
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 #define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc) \
48 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
50 const GeometricField<Type1, PatchField, GeoMesh>& df1 \
54 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
56 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1 \
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 #define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
65 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
67 const GeometricField<Type1, PatchField, GeoMesh>& df1, \
68 const GeometricField<Type2, PatchField, GeoMesh>& df2 \
72 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
74 const GeometricField<Type1, PatchField, GeoMesh>& df1, \
75 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2 \
79 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
81 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1, \
82 const GeometricField<Type2, PatchField, GeoMesh>& df2 \
86 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
88 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1, \
89 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2 \
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 #define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
98 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
100 const dimensioned<Type1>& dt1, \
101 const GeometricField<Type2, PatchField, GeoMesh>& df2 \
105 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
108 const GeometricField<Type2, PatchField, GeoMesh>& df2 \
112 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
114 const dimensioned<Type1>& dt1, \
115 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2 \
119 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
122 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2 \
126 #define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
129 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
131 const GeometricField<Type1, PatchField, GeoMesh>& df1, \
132 const dimensioned<Type2>& dt2 \
136 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
138 const GeometricField<Type1, PatchField, GeoMesh>& df1, \
143 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
145 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1, \
146 const dimensioned<Type2>& dt2 \
150 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > Func \
152 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf2, \
157 #define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \
158 BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
159 BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func)
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 #define BINARY_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
167 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
169 const GeometricField<Type1, PatchField, GeoMesh>& df1, \
170 const GeometricField<Type2, PatchField, GeoMesh>& df2 \
174 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
176 const GeometricField<Type1, PatchField, GeoMesh>& df1, \
177 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2 \
181 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
183 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1, \
184 const GeometricField<Type2, PatchField, GeoMesh>& df2 \
188 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
190 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1, \
191 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2 \
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 #define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
200 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
202 const dimensioned<Type1>& dt1, \
203 const GeometricField<Type2, PatchField, GeoMesh>& df2 \
207 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
210 const GeometricField<Type2, PatchField, GeoMesh>& df2 \
214 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
216 const dimensioned<Type1>& dt1, \
217 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2 \
221 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
224 const tmp<GeometricField<Type2, PatchField, GeoMesh> >& tdf2 \
228 #define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
231 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
233 const GeometricField<Type1, PatchField, GeoMesh>& df1, \
234 const dimensioned<Type2>& dt2 \
238 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
240 const GeometricField<Type1, PatchField, GeoMesh>& df1, \
245 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
247 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1, \
248 const dimensioned<Type2>& dt2 \
252 tmp<GeometricField<ReturnType, PatchField, GeoMesh> > operator Op \
254 const tmp<GeometricField<Type1, PatchField, GeoMesh> >& tdf1, \
259 #define BINARY_TYPE_OPERATOR(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
260 BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
261 BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc)
264 // ************************************************************************* //