1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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<DimensionedField<ReturnType, GeoMesh> > Func \
33 const DimensionedField<Type1, GeoMesh>& df \
37 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
39 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1 \
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 #define UNARY_OPERATOR(ReturnType, Type1, Op, opFunc, Dfunc) \
48 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
50 const DimensionedField<Type1, GeoMesh>& df1 \
54 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
56 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1 \
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
62 #define BINARY_FUNCTION(ReturnType, Type1, Type2, Func) \
65 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
67 const DimensionedField<Type1, GeoMesh>& df1, \
68 const DimensionedField<Type2, GeoMesh>& df2 \
72 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
74 const DimensionedField<Type1, GeoMesh>& df1, \
75 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
79 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
81 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
82 const DimensionedField<Type2, GeoMesh>& df2 \
86 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
88 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
89 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 #define BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \
98 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
100 const dimensioned<Type1>& dt1, \
101 const DimensionedField<Type2, GeoMesh>& df2 \
105 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
108 const DimensionedField<Type2, GeoMesh>& df2 \
112 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
114 const dimensioned<Type1>& dt1, \
115 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
119 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
122 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
126 #define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \
129 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
131 const DimensionedField<Type1, GeoMesh>& df1, \
132 const dimensioned<Type2>& dt2 \
136 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
138 const DimensionedField<Type1, GeoMesh>& df1, \
143 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
145 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
146 const dimensioned<Type2>& dt2 \
150 tmp<DimensionedField<ReturnType, GeoMesh> > Func \
152 const tmp<DimensionedField<Type1, 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<DimensionedField<ReturnType, GeoMesh> > operator Op \
169 const DimensionedField<Type1, GeoMesh>& df1, \
170 const DimensionedField<Type2, GeoMesh>& df2 \
174 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
176 const DimensionedField<Type1, GeoMesh>& df1, \
177 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
181 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
183 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
184 const DimensionedField<Type2, GeoMesh>& df2 \
188 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
190 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
191 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 #define BINARY_TYPE_OPERATOR_SF(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
200 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
202 const dimensioned<Type1>& dt1, \
203 const DimensionedField<Type2, GeoMesh>& df2 \
207 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
210 const DimensionedField<Type2, GeoMesh>& df2 \
214 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
216 const dimensioned<Type1>& dt1, \
217 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
221 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
224 const tmp<DimensionedField<Type2, GeoMesh> >& tdf2 \
228 #define BINARY_TYPE_OPERATOR_FS(ReturnType, Type1, Type2, Op, OpName, OpFunc) \
231 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
233 const DimensionedField<Type1, GeoMesh>& df1, \
234 const dimensioned<Type2>& dt2 \
238 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
240 const DimensionedField<Type1, GeoMesh>& df1, \
245 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
247 const tmp<DimensionedField<Type1, GeoMesh> >& tdf1, \
248 const dimensioned<Type2>& dt2 \
252 tmp<DimensionedField<ReturnType, GeoMesh> > operator Op \
254 const tmp<DimensionedField<Type1, 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 // ************************************************************************* //