1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 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
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) \
32 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
34 const DimensionedField<Type1, GeoMesh>& df \
38 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
40 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1 \
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 #define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc) \
49 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
51 const DimensionedField<Type1, GeoMesh>& df1 \
55 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
57 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1 \
61 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 #define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
66 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
68 const DimensionedField<Type1, GeoMesh>& df1, \
69 const DimensionedField<Type2, GeoMesh>& df2 \
73 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
75 const DimensionedField<Type1, GeoMesh>& df1, \
76 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
80 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
82 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
83 const DimensionedField<Type2, GeoMesh>& df2 \
87 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
89 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
90 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 #define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
99 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
101 const dimensioned<Type1>& dt1, \
102 const DimensionedField<Type2, GeoMesh>& df2 \
106 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
109 const DimensionedField<Type2, GeoMesh>& df2 \
113 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
115 const dimensioned<Type1>& dt1, \
116 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
120 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
123 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
127 #define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
130 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
132 const DimensionedField<Type1, GeoMesh>& df1, \
133 const dimensioned<Type2>& dt2 \
137 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
139 const DimensionedField<Type1, GeoMesh>& df1, \
144 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
146 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
147 const dimensioned<Type2>& dt2 \
151 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
153 const tmp<DimensionedField<Type1, GeoMesh> >& tdf2, \
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) \
168 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
170 const DimensionedField<Type1, GeoMesh>& df1, \
171 const DimensionedField<Type2, GeoMesh>& df2 \
175 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
177 const DimensionedField<Type1, GeoMesh>& df1, \
178 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
182 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
184 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
185 const DimensionedField<Type2, GeoMesh>& df2 \
189 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
191 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
192 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 #define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
201 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
203 const dimensioned<Type1>& dt1, \
204 const DimensionedField<Type2, GeoMesh>& df2 \
208 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
211 const DimensionedField<Type2, GeoMesh>& df2 \
215 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
217 const dimensioned<Type1>& dt1, \
218 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
222 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
225 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
229 #define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
232 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
234 const DimensionedField<Type1, GeoMesh>& df1, \
235 const dimensioned<Type2>& dt2 \
239 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
241 const DimensionedField<Type1, GeoMesh>& df1, \
246 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
248 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
249 const dimensioned<Type2>& dt2 \
253 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
255 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
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 // ************************************************************************* //